Jump to content
  • Advertisement

Archived

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

Noobie20

Reading data from Txt files

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

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!