Top "Cin" questions

std::cin is the global stream object provided by the C++ standard library for reading from the standard input stream.

How do I flush the cin buffer?

How do I clear the cin buffer in C++?

c++ cin io-buffering
When and why do I need to use cin.ignore() in C++?

I wrote a very basic program in C++ which asked the user to input a number and then a string. …

c++ cin getline ignore
Why would we call cin.clear() and cin.ignore() after reading input?

Google Code University's C++ tutorial used to have this code: // Description: Illustrate the use of cin to get input // and …

c++ input iostream cin
Checking cin input stream produces an integer

I was typing this and it asks the user to input two integers which will then become variables. From there …

c++ cin
Multiple inputs on one line

I have looked to no avail, and I'm afraid that it might be such a simple question that nobody dares …

c++ input cin
How to cin Space in c++?

Say we have a code: int main() { char a[10]; for(int i = 0; i < 10; i++) { cin>>a[i]; …

c++ spaces cin
cin and getline skipping input

earlier i posted a question about cin skipping input, and I got results to flush, and use istringstream, but now …

c++ input getline cin
Press Enter to Continue

This doesn't work: string temp; cout << "Press Enter to Continue"; cin >> temp;

c++ string newline cin
Using getline(cin, s) after cin

I need the following program to take the entire line of user input and put it into string names: cout &…

c++ getline cin
C++: how do I check if the cin buffer is empty?

How do you check to see if the user didn't input anything at a cin command and simply pressed enter?

c++ input cin