Answers for "cin does not wait for input"

C++
0

cin does not wait for input

/* cin stops taking input on whitespace encounter
* so if you pass "Prakhar Patel" into cin>>name;
* only "Prakhar" will be stored into name.
* "Patel" will stay in stream and will come into next cin statement.
*/

getline(cin,fullname,'\n'); //use this to capture input stream till \n
Posted by: Guest on September-15-2020

Browse Popular Code Answers by Language