Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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,'
'); //use this to capture input stream till 
 
PREVIOUS NEXT
Tagged: #cin #wait #input
ADD COMMENT
Topic
Name
5+6 =