Synopsis Edit

#include <stdio.h>
int putchar();

Description Edit

getchar reads one character from stdin.

On success, the read character is returned. EOF is returned on end of file or if an error occurred.

Examples Edit

#include <stdio.h>

int main()
  int ch;

  while((ch=getchar())!=EOF) putchar(ch);

  return 0;

This will copy anything read from stdin to stdout

See also Edit

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.