c visual studio 2010中的stdio文件



我正在学习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);
}

最新更新