|
|
1.1 ! root 1: ! 2: ! 3: getchar() STDIO Macro getchar() ! 4: ! 5: ! 6: ! 7: ! 8: Read character from standard input ! 9: ! 10: #include <stdio.h> ! 11: iinntt ggeettcchhaarr() ! 12: ! 13: getchar is a macro that reads a character from the standard in- ! 14: put. It is equivalent to getc(stdin). ! 15: ! 16: ***** Example ***** ! 17: ! 18: The following example gets one or more characters from the ! 19: keyboard, and echoes them on the screen. ! 20: ! 21: ! 22: #include <stdio.h> ! 23: ! 24: main() ! 25: { ! 26: int foo; ! 27: while ((foo = getchar()) != EOF) ! 28: putchar(foo); ! 29: } ! 30: ! 31: ! 32: ***** See Also ***** ! 33: ! 34: getc(), putchar(), STDIO ! 35: ! 36: ***** Diagnostics ***** ! 37: ! 38: getchar returns EOF at end of file or on read error. ! 39: ! 40: ! 41: ! 42: ! 43: ! 44: ! 45: ! 46: ! 47: ! 48: ! 49: ! 50: ! 51: ! 52: ! 53: ! 54: ! 55: ! 56: ! 57: ! 58: ! 59: ! 60: ! 61: ! 62: ! 63: ! 64: COHERENT Lexicon Page 1 ! 65: ! 66:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.