这是我的头文件:
typedef int* Arg;
typedef int* Args[];
typedef int** ArgsList[];
typedef int (*ProcessStart)(Args);
typedef struct PCBEntry{
ProcessStart proc;
Args args;
int pid;
int curr_proc;
int sched_info;
int pc;
} PCBEntry;
我在结构中的 Args args
行收到错误,我不知道为什么。
最佳答案
因为您将 Args
定义为 int *[]
,所以成员 args
被有效地声明为
int *args[];
这是一个灵活的数组成员,它们只允许出现在结构的末尾。
如果您想暗示 Args
是一个指针(与 char **argv
相同),请将其声明为指针:
typedef int **Args;
关于c - 头文件错误 : incomplete type is not allowed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15975453/