只需要将文件标示为二进制即可。
struct student stu[256];
//将stu赋值...
FILE * fd=fopen("c:\\test.bin","wb");//打开
int i;
for(i=0;i<256;i++)//写入
fwrite((void*)&stu[i],sizeof(struct student),1,fd);
//读取第k个结构体
struct student rstu;
FILE *fd=fopen("c:\\test.bin","rb");//打开
fseek(fd,k*sizeof(struct student),SEEK_SET);//定位
fread(&rstu,sizeof(struct student),1,fd);//读取