Anyidea what that means? I get it whenever i use the syntax check on Dev C++ 220.127.116.11. But not when i compile..
1 C:\path\index.cpp [Warning] `nul.gcda' is not a gcov data file
Also, I'v got a question about the following code.
If you notice i am taking a files data, storing it in a string (Thanks Lithorien ) and doing various things with it. Well i'v got a question about the return values..
float returnValue(string itemName);
bool setValue(string itemName);
ifstream iFile("stats.dat", ios::ate);
int size = iFile.tellg();
char* ch = new char[size];
fileData = ch;
float cItemHandle::returnValue(string itemName)
int stringStart = fileData.find(itemName,0);
int stringLineEnd = fileData.find("\n",stringStart);
int valueStart = stringStart + itemName.length() + 1;
int valueLen = stringLineEnd - valueStart;
cout<<"\nStarts At: "<<valueStart;
cout<<"\nEnds At : "<<stringLineEnd;
cout<<"\nReturn Value: "<<fileData.substr(valueStart,valueLen);
bool cItemHandle::setValue(string itemName)
I could easily deal with the return values all being float's, which is what i first planned on. But i decided i might try to expand on that, though i dont know how to handle such things.
Seeing as a method must first run through the string to find the value (which is in this format)
how can i deal with the return type? like i said originally i planned on them all being float values but then decided to see if i could change it to any type. I mean if i could just do a simpe if to check what types they are, thats one thing, but then i still cant return any type.
Down the road when i am pulling data from the string's item values for calculations and whatnot, i should know what everythings data type is (ie height=float, name=string), so that shouldent cause any problems.. i am more concerned about programming for multiple return types.
So how could i handle multiple return types? Thanks