|
From: Phillip S. <ps...@cf...> - 2002-05-02 11:05:57
|
I'll try to restate what I said before to clear this issue up. All standard C IO functions do NOT set the console to raw mode, they leave it line buffered. This means that gets and getchar, which it calls, will not process anything until the end of the line. Once the line ends, getchar() will return each char in the line, one at a time, each time it is called. No chars will be discarded, and only one will be returned at a time. The ONLY function that sets the console to raw mode is the non standard function getch(). All other functions in the C standard leave the console in line buffered mode. getchar() does NOT require that a char be gotten immediately, only that it reads a single char from stdin. At 01:29 AM 5/2/2002 -0700, you wrote: >Ok the rational behind this fix: >- the console cannot be in line mode to get a single char (and return >immediately after, which is what getchar requires) >- the console mode setting shouldn't be done in getc() or any lower >because they work with any kind of file (getchar is specific towards >stdin) > >Ok.. awaiting comments.. > >- Jason |