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

标签 c file include syntax-error

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

return_type sample_fun (FILE *filePtr);

我收到一条编译错误消息,语法错误:可能缺少 ')' 或 ','? 当我包含 stdio.h 时,错误已解决。 stdio.h include 是强制性的吗?我的一些文件在没有包含的情况下也能正常工作。

我在 AIX 上使用 gcc。

最佳答案

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

关于c - C 中的 FILE 是否需要包含 <stdio.h>?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5841703/

相关文章:

c - string.h 和 stdlib.h 函数给我错误 : undefined reference to '...'

c - Linux GKI 代表什么?

c - 在 IAR IDE 中预期为 ")"

c - 8 位枚举,在 C 中

node.js - 将文件从 Base64 转换并作为二进制文件发送到某些外部服务

android - 嵌套的preferences.xml

c - 尝试使用 clock_gettime(),但从 time.h 中得到大量 "undeclared"错误

django - 如何通过Django中的链接下载上传的文件

file - Electron sheetjs从JSON下载生成的文件

C++ 尝试使用#ifndef 和#include 语句