1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <stdio.h> #include <stdlib.h> int main(int argc, char **argv) { FILE *in=stdin; FILE *out=stdout; while(1) { char buf[2]; int l=fread(buf,1,1,in); if(l==0)break; buf[l]=0; fwrite(buf,1,l,out); } return EXIT_SUCCESS; }