blob: 39d994f8f15a6d19b6ac737da59344c0e6bdfe9e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#include <stdio.h>
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;
}
|