invalid application of ‘sizeof’ to incomplete type

sizeof 后面所跟的数据类型没有定义,或者找不到定义的地方

eg:

头文件中定义结构体如下:

struct PersonaL{

   char name[];

        int  age;

};

但是在cpp中使用时如下:

struct personal a;

int len = sizeof(a);

原文地址:https://www.cnblogs.com/rohens-hbg/p/10950596.html