Skip to content

Instantly share code, notes, and snippets.

@uhziel
Created September 25, 2011 16:34
Show Gist options
  • Save uhziel/1240809 to your computer and use it in GitHub Desktop.
Save uhziel/1240809 to your computer and use it in GitHub Desktop.
apue.2e.fig1.5.c
#include "apue.h"
int main()
{
int c;
while ((c = getc(stdin)) != EOF)
{
if (putc(c, stdout) == EOF)
{
err_sys("putc error");
}
}
if (ferror(stdin))
{
err_sys("input error");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment