Are Numbers read the same way as characters from input buffer?

In this video it is said that if we type HelloWorld,this first goes into the input buffer and then from there each character is picked up for the loop and checked,does it work the same way for numbers?Like if in the console we write 1234,is each number picked up and checked for the loop?It doesnt work like that right?So I am confused what is the difference,or if I am understanding the whole thing wrong?

hello @Nitin-Bhattacharyya-2319140631658033 you were reading about cin.get() .right?

Yes I was reading about cin.get() and how while storing characters all the characters are stored in input buffer after pressing enter and the loop checks the condition from input buffer by checking each character.

hello @Nitin-Bhattacharyya-2319140631658033 there is one property that cin.get does is that it reads whitespaces too .
input buffer thing is very different from it .

@Nitin-Bhattacharyya-2319140631658033 here input buffer means that cin.get(s,25) deamands input like this and this means because it has the property of reading white spaces too rather than not terminating on encountering with white spaces it remains in buffer till the number of characters you have given in input to take for the input .
like as in the above i have given 25 as input with cin.get() so it will run a loop for 25 times and till that it will be in buffer to take the complete input .
i hope i have cleared your doubt but if you still have any query please ask here .
Happy Learning !!

Thanks for clearing it. I understand it now.

@Nitin-Bhattacharyya-2319140631658033 please mark this doubt as resolved now .
Happy Learning !!

char ch;
cin>>ch;
cout<<ch;
input: nitin
output: n
so why in this video ,it is displaying whole string?
is it because of this loop?
while(ch!=’.’)
{ cout<<ch;
ch=cin.get();
}
Can you explain the process a bit again please?

hey @Nitin-Bhattacharyya-2319140631658033
you are doing a bit wrong :
#include<bits/stdc++.h>

using namespace std;

int main(){

char ch[100];

cin>>ch;

cout<<ch;

}

input : nitin
output : nitin

try to do in this way .
if you feel that your query is resolved please mark this doubt resolved and please do hit the like button .

Happy Learning !!

no,I understand,I too generally use an array but in the video the loop I mentioned was used,that is without using an array the whole thing was displayed.


I wrote the exact code here.As you will see for the first part of the code which is the loop the whole string will be read but not for the second part of the code. I want to understand why that happens

@Nitin-Bhattacharyya-2319140631658033 please reed the comments in the code :


you are interpreting it in the wrong way .
even if you try to print something different in the while loop it will also print that also because every character input and output is performed irrespective of your output .
please ask if you still have any doubt .
Happy Learning !!

Hey thanks a lot,it was really to the point explanation. I will mark it as resolved