我有以下代码:
struct student_info;
void paiming1(struct student_info student[]);
struct student_info
{
int num;
char name[6];
};
Run Code Online (Sandbox Code Playgroud)
IDE出错
error: array type has incomplete element type ‘struct student_info’
void paiming1(struct student_info student[]);
Run Code Online (Sandbox Code Playgroud)
但是,如果我使用void paiming1(struct student_info *student);它工作正常.这是为什么?我正在使用GCC.