我正在学习c,我正在努力学习在网络上可以找到的许多例子
因为我在访问某些stdio
关键字和typedef
时遇到问题或类型。
例如
#include <stdio.h>
int main()
{
File *f; ---->error : identifier "f" is undefined
//or found via codeblocs intellisense i also tried filebuf
filebuf *f; ---->error : identifier "filebuf" is undefined
// though this would compile
getc('');
}
因为它无法调用File
结构
File应更改为FILE
。此外,getc
函数采用File指针而不是''
,filebuf应更改为_iobuf
。
#include <stdio.h>
int main()
{
FILE *f;
//_iobuf *f;
f = fopen("somefile","r");
getc(f);
}