View Single Post
Old 02-5-2014, 01:21 PM   #2
justin_ator
🥓<strong><span style="col
Resident Overseer
FFR Veteran
 
justin_ator's Avatar
 
Join Date: Mar 2007
Location: Kingsport, TN
Posts: 7,648
Default Re: Instream not working for file inputs (C++)

I looked into errors with it online and maybe this would be helpful:

Code:
3. Lastly, and perhaps more tricky. After reading the employee id using fin>>id; there will be a newline character remaining in the input buffer.
This causes the next getline() to retrieve an empty line, and throws everything out of sync.
To fix this, insert after the opening brace at line 59:
 
        fin.ignore(); // ignore newline character
__________________

Last edited by Zageron; 02-5-2014 at 01:34 PM..
justin_ator is offline   Reply With Quote