Do you have: cin <variableName;
lines of code? I ran into getline (), skipping runtime errors when I used:
cin <intwariable and subsequently getline (cin, variable) .
This is because the cin stream object contains an input buffer. When you enter a newline, I assume that it narrows from the stream going to the asisgnment variable, but is still contained within the cin object itself.
One workaround I've used is cin.ignore () ; after cin <integer .
Another user mentions parsing all getline input into integers, floats — not root beer — and strings. Good luck and check your code for the double use of cin and getline ().
user3053416
source share