49,761 Topics
| |
how can i cast a string to int when i have this [code=cplusplus] //input problem numbers cout<<"\n""enter the numbers"; //numbers represents what they input string numbers; getline(cin,numbers); //position represents at what location value comma is int position; while(numbers.find(',') !=string::npos) { //print out what the user inputs //used to split up … | |
Hi I have a string & I want to grab certain elements out of the string & save them in an array. I have searched for an answer to this but I have not found a solution to what I am trying to do. What I am trying to do: … | |
Hello All, I'm compiling my program, and i keep getting this error: [code]obj/Debug/fubar.o||In function `fubar::fubarl(int*, int*)':| /home/miguel/Documents/pointersandref/fubar.cpp|7|multiple definition of `fubar::fubarl(int*, int*)'| obj/Debug/fubar.o:/home/miguel/Documents/pointersandref/fubar.cpp|7|first defined here| ||=== Build finished: 2 errors, 0 warnings ===| [/code] This is my complete source code fubar.cpp [code=C] #include <string.h> #include <stdio.h> #include "fubar.h" void fubar::fubarl(int *foo, … | |
Yeah, I'm aware it may be an stupid question, but I really don't know what a "template" in C++ is, because my knowledge on it is very limited, I don't have any good books on it so I really can't get as much knowledge as I would like from it. … | |
hi i am doing a program that has to order a great set of numbers, but i need to use threads i am working with microsoft visual c++ 6.0 and i use windows.h when i tested the program, my threads used only 25% of the processor and i am very … | |
hii again ..sorry but this project is kinda killing me anyway just small Q ? how can I burn my (c++) project in a CD ? my friend did it but they faced a problem that when they wanna open it in the Teacher computer they had to copy it … | |
I am trying to write a program that will open a specific file and go through it, writing the data I need to another file. Everytime the tag 'Step 4[2]' comes up I need to get the next two numbers and write them to a seperate file. (the purpose is … | |
Yeah, probably a bad place to post this, but I'm desperate! I am trying to install GTK+ under Linux but have no idea what is going wrong!!! I see that i need like fifty million packages to install it, but i can't get this working! can anyone give me advice? … | |
hello this code seems to give me wrong results and i carnt figure out why :( [code]#include <iostream> int main() { float pi = 3.142; char area; float diameter; area = diameter * pi; std::cout << "Hello. Please imput the diameter of your circle... "; std::cin >> diameter; std::cout << … | |
after i've got this error: pure virtual method called terminate called without an active exception Abort (core dumped) i searched and found that it is probably because i'm calling to a pure virtual function from a constructor. well, yes, i'm doing that, but - - what is wrong with that? … | |
Hey, i've wrote a script that will test three diffrent sorting methods and display how much time each method took to complete in order to compare the diffrent methods. The problem is that i'm suppose to show the results inside a 2 dimentional graph, and i'm not that much of … | |
I am really stumped with a problem my program keeps giving me. Randomly, a file I try to open returns fail() to ifstream and can't be read from. I have a feeling it has to do with these 2 functions I have been using. Please help. Thanks! PS: I tried … | |
I have a program which is supposed to find the shortest path between airports and users' flight data to find the shortest path between airports; that is, the airports are the nodes and the flights are the edges. I've not started to implement the algorithm as yet but I am … | |
Hi, What can I do for this error? error C4430: missing type specifier - int assumed. Note: C++ does not support default-int. | |
I have a program that is using command line arguments to tell the program what to do. So to run the program, you type in: main airports.txt SC PER, where SC is a different thing the program can do and PER is the code for a city. So PER is … | |
hii How to open a directory using createfile() ? Any idea..? Thanking you. | |
hii everyone ^^ My project for the c++ course is due tomorrow but am facing a problem this is the function [CODE] int i=0,x , ar[100]; double a_d,y=1; cin>>a_d; while (y!=0) { y=a_d*10; x=static_cast<int> (y)%10; cout<<endl<<"after "<<y<<endl<<"the number "<<x; a_d=y-x; i++; } cout<<i; return 0 ; }[/CODE] what I wanna … | |
I need some help with a program I'm working on, I have to calculate the cost of a long distance phone call based on the day, time and length of the call. This is what I have so far. I need to figure out how to test what day they … | |
hello every one got a new doubt what is the syntax to use the years in c++ from the inbuilt date class | |
| Hello, can you help me with this problem: I'm extending the TListView to enable notifying me about the column resize. I've found the code written in Delphi, but I needed to use it in C++, so I decided to rewrite this code to C++. But first problem occurs when I … |
Are there any C\C++ libraries what will allow me to plot in real time? If any explanation is needed the perfect example I saw of this was for a API, Swarm, that is used for simulating large numbers of agents. In my program with it a bunch of workers basically … | |
Hello , I have a source code that could potentially upload files onto an FTP server using winsock. But there seems to be a small glitch and the files are not getting uploaded. Could someone please guide me as to why this is happening. I would be forever indebted. thanks … | |
I want to find the first null child in a tree and return that node of the tree. Im thinking something like this but it doesnt seem to work the way I want. [code=cplusplus] node *Find_Empty_Node(node* root) { int index = 0; if(root) { if(root->data == 0)//<--I want this child … | |
hey guys, I have a fixed length .txt file. Values in the file correspond to columns in a db table. ex file row is something like: [B]India 3455 78787 89898[/B] table has columns something like: [B]column_name length startPosn EndPosn[/B] country 6 1 6 ID 6 7 13 so you see … | |
Hey guys, So I have compiled my first home-written static library (named PixGUI) that happens to call OpenGL functions. However, I noticed that when compiling (using MinGWs GCC with Code::Blocks project set to "static library") it doesn't matter whether I supply the linker with libopengl32.a or not, it simply compiles … | |
Hey, I am curious about making an application that will show current printers that are installed on the computer, will be windows XP, and at first returning them back for the user to see in command prompt. Although I am unable to find out how I can check to see … | |
I have to develop a Academic Automation System as College project in OOP C++. need your help in this regard so i can complete it. I already have defined the following classes, 1-CourseAdministrator 2-Student 3-Tutor 4-Course 5-CreateLogin 6-Security (For Validitaion, check for login and password) is there any meterial which … | |
[code=c++] #include<iostream> #include<string> using namespace std; struct one { char name_book[80]; char name_author[80]; int no_of_books; }one1[500]; int insert() { int i,j; cout<<"Enter the No. of Books you want to enter : "; cin>>i; cout<<endl; for(j=0;j<i;j++) { cout<<"Enter the name of book "<<j+1<<" : "; cin>>one1[j].name_book; cout<<"Enter the name of the … | |
[CODE="Visual Studio 2008"] #include "storage_sql.h" #include <string.h> #include <stdio.h> #include <stdlib.h> #define strcasecmp _stricmp #include <cstring> #include <cstdlib> #include <string> #include <sstream> #include <algorithm> #include "compat/snprintf.h" #include "common/eventlog.h" #include "common/util.h" static const char * sql_backslash_to_underscore(const char * key) { if (!key) { ERROR0("got NULL key"); return NULL; } std::string rep … | |
Hi guys. I've worked on OOP before, and since in general 'get' functions are used to return private attributes in classes, I was thinking how I could make this test code work. [CODE=c++]#ifndef _testing_h #define _testing_h class Testing { private: char * name; public: Testing(); Testing(char*); ~Testing(); char* getName(); void … |
The End.