Jump to content
  • Advertisement


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


Reading data from Txt files

This topic is 6054 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

Im having trouble with the sscanf command. For some obsucre reason the NUMQUADS line works fine. I copy and paste the same two lines for NUMSECTORS and change a few variables...and it doesn''t work (by that i mean the numSectors value remains 0). The original code was taken from one of nehe''s tuts. I think the gap in my understanding is the $d / $f ?????? readstr(filein,oneline); sscanf(oneline, "NUMQUADS %d\n", &numQuads); levelData.map[mapLoop].sector[secLoop].quad = new QUAD[numQuads]; levelData.map[mapLoop].sector[secLoop].numQuads = numQuads; readstr(filein,oneline); sscanf(oneline, "NUMSECTORS %d\n", &numSectors); levelData.map[mapLoop].sector[secLoop].s = numSectors; for (int loop = 0; loop < numQuads; loop++) { readstr(filein,oneline); sscanf(oneline, "%f",&displist); levelData.map[mapLoop].sector[secLoop].quad[loop].displist = displist; Can anybody help me please?

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!