Archived

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

Reading data from Txt files

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