error: 'FILE' undeclared (first use in this function)
今天在打trace调试底层代码的时候添加:
{
FILE* fp = fopen("/sdcard/gaomatrix.txt","a+");
if(fp)
{
fprintf(fp, "XXE_RefMode_A1 \n");
fclose(fp);
}
}原来是少添加了:#include <stdio.h>
本文介绍了一个常见的编程问题,即在使用C/C++语言进行文件操作时遇到的FILE未声明错误。通过一个具体的例子展示了如何通过包含正确的头文件<stdio.h>来解决此问题。
error: 'FILE' undeclared (first use in this function)
今天在打trace调试底层代码的时候添加:
{
FILE* fp = fopen("/sdcard/gaomatrix.txt","a+");
if(fp)
{
fprintf(fp, "XXE_RefMode_A1 \n");
fclose(fp);
}
}原来是少添加了:#include <stdio.h>

被折叠的 条评论
为什么被折叠?