• ### Announcements

#### Archived

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

# quick problem with file input

## Recommended Posts

_SKOTTIE_    122
in my level script editor files... there are descriptions of each enemy so they can be identified in teh editor, but my game (in another program) does not need these descriptions, and needs to just feed it into garbage. each description is on its own line. thusly: this is a SSF file (stage script file)
Data/lvl1back.sdf
50
1
Data/enemy1.sdf
1
5000
200
-200
0
75
100
[1] Green Plane

the information from Data/Enemy.sdf to [1] Green Plane is all enemy information. however [1] Green Plane is the description, when i try this (in_file is a ifstream): in_file.getline(garbage, 50); it reads the line in fine, but when i loop (with multiple enemies) to start reading the enemy information (such as the SDF file for the next enemy), it reads in that same line. it seems that getline does not push the read cursor to the next line when it gets it. how would i skip this extra line? thanks guys!

##### Share on other sites
GamerSg    378
Just use getline again to move the line down.

##### Share on other sites
_SKOTTIE_    122
worked like a charm, thanks!