是否需要<stdio.h>包含C中的FILE?

San*_*San 0 c file syntax-error include

我的c文件(sample.c)有一个头文件(sample.h).当我在我的头文件中原型化一个函数,如下所示.

return_type sample_fun (FILE *filePtr);
Run Code Online (Sandbox Code Playgroud)

我得到一个编译错误说,Syntax error: possible missing ')' or ','?当我包含stdio.h时,错误已解决.stdio.h是否包含强制性?我的一些文件在没有包含的情况下运行良好.

我在AIX上使用gcc.

Ern*_*ill 5

是的,类型FILE定义在stdio.h; 如果你提到它,那么你必须包含该文件.