在linux下man帮助一下,就可以看到,fread需要引用stdio.h man fread FREAD(P) FREAD(P)NAME fread - binary input SYNOPSIS include <stdio.h> size_t fread(void *restrict ptr, size_t size, size_t nitems,FILE *restrict stream);参数一:接收数据的指针(可以是字符数组,结构数组等)...
fread(buf,strlen(msg)+1,1,stream);printf("%s\n",buf);fclose(stream);return0;}