Program is skipping cin.getline in loop?

...
Last edited on
you probably need to ignore any character in the input stream by using cin.ignore() just before the cin.getline() statement.

Aceix.
First of all. Why are you using a character array, and then keep saying string string string, instead of just using std::string ?

To fix your problem. Try putting a cin.ignore(); just above your cin.getline
Last edited on
just put cin.sync() on line 52.
just put cin.sync() on line 52.
Bad advice:
1) Does not on every platform
2) Even on Windows it depends on many settings (including common one which speeds up streams considerably and is often used)
Thanks, and noted for myself. I retract my suggestion.
Topic archived. No new replies allowed.