我在文件“vector.c”中有这个结构:
struct Vector
{
int * m_items;
int m_size;
int m_extSize;
int m_numItems;
};
在“main.c”上,我试图检查某个向量的值 m_items 是否为 NULL :
if (! vec->m_items)
printf("not fail\n");
我在使用值初始化“vec”之后执行此操作 - 向量有 1 个值(我检查了它)。但是,gcc 正在为上面的行写一个错误:
Error: dereferencing pointer to incomplete type
为什么?