Archived

This topic is now archived and is closed to further replies.

WTF is wrong with strcmp? URGENT!

This topic is 5625 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Here is the start of my map file: QuadTree map file V1.0 Ambient=0.400000 0.400000 0.400000 Diffuse=0.600000 0.600000 0.600000 And my loader code:
	fgets(string,100,FP);
	Output(string);
	if(stricmp(string,"QuadTree map file V1.0\n")!=0)
	{
		Output("Terrain::LoadFromFile : Incorrect file format\n");
		return -2;
	}
 
The log file is... QuadTree map file V1.0 Terrain::LoadFromFile : Wrong file structure So what''s up? I tried the test string with and without the \n, and tried stricmp, even strncmp on the first two characters didn''t work. I can SEE the string is read properly! This is really annoying me
Read about my game, project #1
John 3:16

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
uhm... maybe you should show us the code where you actually print the error message.
"Terrain::LoadFromFile : Wrong file structure"

Share this post


Link to post
Share on other sites
Sorry everyone, I didn''t notice when the error changed from wrong file format to wrong structure. The hardest errors to fix are the stupidest ones eh
Thanks for the help though guys, sorted now.



Read about my game, project #1



John 3:16

Share this post


Link to post
Share on other sites