cin: clearing the buffer

If i use cin.ignore(), when i use getline(cin, var1) it will just forget about the first character in var1. Also, for some reason, cin.ignore also makes cout not display anything at all in the rest of the function until some form of cin is used.

Is there any effective way to clear the stream without affecting anything else?

I tried cin.clear() and it didnt do anything.
Last edited on
All ignore() does is that it reads one character from the stream and throws it away.
yes, i figured that out... So, how can I clear the stream?
I've heard of cin.sync(); n dint know if it'll work.
Topic archived. No new replies allowed.