this only prints % .....what am i doing wrong?
the very first line is
%2004-10%
Code:int seekMonth(char *file, Date &)
{
int length;
fstream fin;
fin.open(file, ios::in);
fin.seekg(ios::end);
length = fin.tellg();
fin.seekg(ios::beg);
char *line;
line = new char[length];
fin.getline(line, length);
if(*line == '%')
{
cout << line << endl;
}
return 0;
}
i have stripped my code down and ran it so there is no more to this code.