I'm finishing up the last two functions for my myString class, operator>> and getline().
The problem occurs when I use >> to read in a word.
if I do
1 2
myString teststring;
cin >> teststring;
and enter "this is a test"
the function works properly, and teststring now contains "this"
now if I call getline(cin,teststring2), it never asks for input, it grabs the rest of the line I entered in before, and teststring2 contains " is a test"
How do I tell it to flush out that input buffer so that I can get new input. cin.ignore() only clears one char, so I get " s a test"