刚学C
我写了以下内容:
void main(void)
{
unsigned int curr_dat = 0; // The current dat file to use
unsigned char ch = 0; // Key entered at keyboard
unsigned char lastkey = 0; // Last key entered (movement command)
FILE *fp;
}
但是我在尝试编译时遇到了这些错误:
错误 C2065:“FILE”:未声明的标识符
错误 C2065:“fp”:未声明的标识符
警告 C4552:“*”:运算符无效;具有副作用的预期运算符
我不确定为什么我相信 FILE
是 C 中的有效标识符
我正在使用 VS2012 的 Developer Command Prompt 进行编译
最佳答案
FILE
is declared in stdio.h
.添加#include <stdio.h>
到文件的顶部。
关于c - 未声明的标识符 - 不确定为什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39041040/