Skip to main content
gamedev.net
🔒 Locked

Nehe's Model Tutorial Problem #2

Started by MarcusMaximus 3 replies 750+ views
Original Post
MarcusMaximus
MarcusMaximus
In the following lines of nehe''s model tut: byte *pBuffer = new byte[fileSize]; inputFile.read( pBuffer, fileSize ); inputFile.close(); I get an error saying that the read function''s first parameter is a char * type. I tried changing pBuffer to a char * but it gave me a runtime error and crashed. What do I have to do to make it work? -Mark
-Mark
moo_ski_doo
moo_ski_doo
Have you tried casting pBuffer to a char pointer:

inputFile.read( ( char * )pBuffer, fileSize );

?

Might work, might not...
-Mark.
MarcusMaximus
MarcusMaximus
Ok, well i fixed the errors but now i get a message saying "Invalid Allocation Size 4294967295 bytes." I have no idea what this means! plz help!
-Mark
moo_ski_doo
moo_ski_doo
That''s a pretty big number! That''s not the size of the array you''re trying to create is it? At what point are you getting that error? Compile-time or run-time?


-Mark.
-Mark.
MarcusMaximus
MarcusMaximus
at runtime. I straight copy-pasted nehe''s code so the array shouldnt be that big...
-Mark

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.