line 29 is wrong
while( fgets (buffer , 20 , pFile) )
{
// blabla
}
fgets() normally adds the '\n' that is in the file at the end of the input string that you need to strip off. And it would make your life a lot easier if you would put the strings in an array instead of concantinating them into one big string.
while( fgets (buffer , sizeof(buffer) , pFile) )
{
if( buffer[strlen(buffer)-1] == '\n')
buffer[strlen(buffer)-1] = 0;
// blabla
}
Last edited by Ancient Dragon; Oct 16th, 2007 at 8:46 pm.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Offline 21,953 posts
since Aug 2005