小编pur*_*Zer的帖子

关于形式参数中的C struct数组的错误

我有以下代码:

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.

c function-declaration incomplete-type

9
推荐指数
3
解决办法
330
查看次数

标签 统计

c ×1

function-declaration ×1

incomplete-type ×1