0
Hello everyone, how to clear the input "cin" buffer in C++?
5 Antworten
+ 2
while(cin.get() != EOF);
0
and how to add the next input, you need to clean the first input from unnecessary input data so that when outputting subsequent ones, these unnecessary ones are not written. but at the same time I want to enter new values and display them already
0
Can you give me some sample inputs, so I can know what's necessary and what's not.
0
Input: 1 2 3 4 5
Cout<<1<<2
Input: 3 89 3
Cout<<3<<89