当前位置: 技术问答>linux和unix
fread()函数
来源: 互联网 发布时间:2016-08-08
本文导语: 利用fread()读写结构体,都是返回0 不知道啥原因 fread() and fwrite() return the number of items successfully read or written (i.e., not the number of characters). If an error occurs, or the end-of-file is reached, the return v...
利用fread()读写结构体,都是返回0
不知道啥原因
fread() and fwrite() return the number of items successfully read or written (i.e., not the number of characters). If an error occurs, or the end-of-file is reached, the return value is a short item count (or
zero).
不知道啥原因
fread() and fwrite() return the number of items successfully read or written (i.e., not the number of characters). If an error occurs, or the end-of-file is reached, the return value is a short item count (or
zero).
#include
#include
#include
#define MAX 10
struct people
{
int id;
char name;
};
void init(struct people w[], int n)
{
int i;
for(i=0;i