我正在使用 C89 编译器,但遇到了一些指针输入错误。
调用代码:
struct cpu_state_type cpu_state;
//Stuff here....
foo()
{
print_out_cpu(&cpu_state);
}
Print_out_cpu 在别处定义,H 文件包含在其中。
struct cpu_state_type
{
int r[12];
};
void print_out_cpu(struct cpu_state_type *c);
我得到错误:
error: incompatible type for argument 1 of 'print_out_cpu'
据我所知,&cpu_state
返回 type cpu_state_type*
,所以我很困惑。