#include int main(int argc, char **argv) { FILE *f; if(argc>1)f=fopen(argv[1],"r"); else f=stdin; setvbuf(stdin,NULL,_IONBF,0); setvbuf(stdout,NULL,_IONBF,0); char c; printf("-- read from file byte by byte --\n"); while(fread(&c,1,1,f)) { printf("%c",c); } printf("\n-- no more data on this file --\n"); return 0; }