Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 预期的声明说明符或‘’;在‘之前;文件’;_Linux_File Handling_Gcc - Fatal编程技术网

Linux 预期的声明说明符或‘’;在‘之前;文件’;

Linux 预期的声明说明符或‘’;在‘之前;文件’;,linux,file-handling,gcc,Linux,File Handling,Gcc,我正在用c编写代码。 我正在主函数(main.c)中声明一个文件*fp。 项目中还有其他文件。 因此,在头文件中,我得到了以下错误: “文件”问题之前的“预期声明说明符或“…” 在这一行: void myfunct(argumenttype参数,文件*fp) 我做错了什么 在Linux(gedit+gcc)中工作。argumenttype是指向结构的类型定义的指针。 typedef struct testStruct testptr; void myfunct(testptr test, FIL

我正在用c编写代码。
我正在主函数(main.c)中声明一个文件*fp。
项目中还有其他文件。
因此,在头文件中,我得到了以下错误:
“文件”问题之前的“预期声明说明符或“…”
在这一行:
void myfunct(argumenttype参数,文件*fp)

我做错了什么


在Linux(gedit+gcc)中工作。

argumenttype是指向结构的类型定义的指针。

typedef struct testStruct testptr;
void myfunct(testptr test, FILE *fp);
我刚刚在这个头文件中包含了stdio.h。 而且效果很好。 所以无论我在哪里使用依赖于库的函数或类型定义的类型,我都必须包含相关的库


多谢各位

在使用typedef'd元素之前必须包含标题,否则
文件对编译器来说没有任何意义,它也不知道它在看什么。

是否包含stdio.h?什么是“argumenttype”?如果你把你的帖子标记为mod,他们可能会把这些信息移回你的问题中。我不完全清楚你有什么选择,如果有的话,可以将其作为你账户的一部分收回。