Can you please explain the concept of input buffer and cin.get in easier terms ?
Input Buffer and cin.get
hello @ritkumar
whatever input we give to computer it get stored in input buffer and then cpu read those input from the buffer.
it is function that reads one character at a time from the buffer,
So this problem of skipping one memory space comes only when we are using cin.getline right?
no getline function is used to read complete line (it may include space as well)
the issue arise whe we try to read linr using cin>>variablename
in this case , space will be treated as delimeter and we will not be able to read complete string
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.