|
-
July 27th, 2010, 10:55 AM
#8
Re: why is it skipping lines?
The key thing is to put an ignore between a normal cin and a getline----but not put one between two getlines. This can cause some difficulties if you're accessing the same stream in multiple functions.
The approach I usually take is to use getline() for every line, and then parse the line separately if necessary using a stringstream. That gets around the whole issue.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|