When using getchar to read a character from the user:
asc = getchar();
It would seem that this would only read one character, however, in this case it reads until ENTER is pressed! And as far as I understand it, C stores the input somewhere and allocates it ordinarily later if more "getchars" are used.
For example: if the user inputs "Hello", then asc would get H's ASCII value, BUT, C will remeber the characters "ello" and allocate them later or something.
Could anyone please explain what's the thing with this command?
Thank you.
Tags: