>>>>> "SR" == Senthil-Raja <> writes:
SR> The getchar() function is expected to fetch the next character
SR> in the input stream and return it.
SR> But, when I wrote a program using this function, it looks like
SR> the reading of the input stream happens only after I press the
SR> ENTER key.
SR> Please someone explain why this is happening.
SR> Regards, Senthil-Raja.
The short answer is buffering. Basically collects an entire line of
input before it sends it to your program.
You should also read question 19.1 in the c FAQ at c-faq.com.
(at least I as I think thats the right question. I couldn't get
c-faq.com to load and used an outdated copy at
http://www.faqs.org/faqs/C-faq/faq/)