竟然struct file的竟然没有成员

来源:互联网 发布:get是什么意思网络用语 编辑:程序博客网 时间:2024/06/09 21:48

不知道为什么,编译器没有通过,说file没有这个结构

也许是编译器的原因吧,到网上有关这个结构体的资料也蛮少的。

不过这个结构体本身占用了32个字节。

 

 

#include<stdio.h>
#include<stdlib.h>


int displayfileinfo(FILE * fp)
{
/*
if(fp==NULL){printf("Cannot open file/n");exit(1);}
printf("The file in memorybuffer level is %d/n",&fp->level); 
printf("The file status flags is %d/n",&fp->flags);
printf("The file discription is %c/n",&fp->fd); 
printf("The file in memory buffer size is %d/n",&fp->bsize);
printf("The file in memory buffer address is %d/n",fp->buffer); 
*/
/*
if(fp==NULL){printf("Cannot open file/n");exit(1);}
printf("The file in memorybuffer cleft is %d/n",fp->cleft); 
printf("The file next char is %c/n",fp->nextc);
printf("The file discription is %d/n",fp->fd); 
//printf("The file in memory buffer size is %d/n",&fp->bsize);
printf("The file in memory buffer address is %c/n",fp->buff);
 */  
}

int main(void)
{
FILE *fp,fp1;
fp=fopen("test.txt","r+");
if(fp==NULL){printf("Cannot open file/n");exit(1);}   
//displayfileinfo(fp); 
 printf("The file struct size is %d/n",sizeof(fp1));
 while(1){};
   
}

 

 

 

原创粉丝点击