33,311
社区成员
发帖
与我相关
我的任务
分享
VC中
在"stdio.h"中有如下定义
struct _iobuf {
char *_ptr; //文件输入的下一个位置
int _cnt; //当前缓冲区的相对位置
char *_base; //指基础位置(即是文件的其始位置)
int _flag; //文件标志
int _file; //文件的有效性验证
int _charbuf; //检查缓冲区状况,如果无缓冲区则不读取
int _bufsiz; //文件的大小
char *_tmpfname; //临时文件名
};
typedef struct _iobuf FILE;
if((fp = fopen("a.txt", "at+")) == NULL)
{
cout < < "Can't open the file" < < endl;
return;
}
for(int i=0; i < 5000; i++)
{
if(i == 4095)
fputs("@", fp);
fputs("g", fp);
}
fclose(fp);
return;
struct _iobuf {
char *_ptr;
int _cnt;
char *_base;
int _flag;
int _file;
int _charbuf;
int _bufsiz;
char *_tmpfname;
};
typedef struct _iobuf FILE;
- stream 0x00424aa0
+ _ptr 0x00000000 ""
_cnt 0
- _base 0x00000000 ""
CXX0030: Error: expression cannot be evaluated
_flag 1
_file 3
_charbuf 0
_bufsiz 0
- _tmpfname 0x00000000 ""
CXX0030: Error: expression cannot be evaluated