Code:
string str2="test.txt";
ifstream file(str2.c_str (),ios::in);
and another question please when file.tellg() return -1?
Code:
while(file.tellg()<=lastEnd)
					{
						file.getline (temp,20,'=');
			if (strncmp(temp,varName.c_str(),varName.length())==0)
						{
							file.getline (X,20);
							return true;
						}
						file.ignore(30,'\n');
					}
when i debug this code and make it print lastEnd and file.tellg() values through the iteration of the loop every thing is fine until file.tellg() return -1 in the middle of the file so the loop doesn't end??!!!!!