For eg: if the code is :
cin>>ch;
while(ch != ‘.’)
{
cout<<ch;
cin>>ch;
}
And I give the input at console as " This is input"
What happens when input buffer sends white space to the program through cin ? Also if cin doesn’t send it to the program at all, does it simply discard that input ?
Also in case of an array, if we do:
int arr[50];
cin>>arr;
cout<<arr;
and try to give white space as input, the string is trimmed and nothing after the white space is read, why is that?:
INPUT: “This is Input”
OUTPUT: “This”