The fread library function is used to read data from a file stream. Data is read into a data buffer given
by ptr from the stream, stream.
#include <stdio.h>
#include <sys/types.h>
int main()
{
FILE *new;
size_t item;
char buf[100];
new = fopen("new-1", "r");
item = fread(buf, 10, 4, new);
printf("fread returned item count are: %d\n", item);
return 0;
}
[root@localhost Desktop]# ./fopen_read.exe
fread returned item count are: 4
The fread library function is used to
The
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |