Back

/* unbuffered single character input */
#include<stdio.h>

#undef getchar

int getchar(void);

int main()
 {
  int c;
  while ((c=getchar())!=EOF) putchar(c);
  return 0;
 }

int getchar(void)
 {
   char c;

   return (read(0, &c, 1) == 1) ? (unsigned char) c : EOF;
 }

Top