WTF is wrong with strcmp? URGENT!

Started by
2 comments, last by d000hg 21 years, 9 months ago
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
Advertisement
Drop the "!=0" in the if() and try that...

CEO Platoon Studios
[email=esheppard@gmail.com]esheppard@gmail.com[/email]
uhm... maybe you should show us the code where you actually print the error message.
"Terrain::LoadFromFile : Wrong file structure"

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

This topic is closed to new replies.

Advertisement