[prev] 24 [next]

Stack as ADO (cont)

Sidetrack: Character I/O Functions in C   (requires <stdio.h>)

int getchar(void);

  • returns character read from standard input as an int, or returns EOF on end of file

int putchar(int ch);

  • writes the character ch to standard output
  • returns the character written, or EOF on error
Both functions do automatic type conversion
  • putchar('A') has the same effect as putchar((int)'A') (explicit type conversion)