Mail Archives: djgpp/1998/08/10/21:59:15
Hi, I think this is a little off-topic question, but anyway...
I'm reading K&R and, in the example 1.5 I have to use gecthar(), which
should return _the pressed character_, and, redirect it to the screen
with putchar(). Everything works fine except getchar, which only returns
me the _single or multiple character stream_ I'm writing when I press
<\n>. Why? Here is the code:
#define EOF -1
main()
{
int c;
c = getchar();
while ( c != EOF)
{
putchar(c);
c = getchar();
}
}
TIA
Leandro M. "Inkel" López (mailto:inkel AT sion DOT com)
Directly from Argentina. (Excuse my english)
- Raw text -