小编Sta*_*pro的帖子

表达式必须是指向完整对象类型的指针,为什么在这种情况下会出现此错误?

这是我的情况的简化:

头文件.h

#DEFINE NUMBER 3
extern char reserved[][];
Run Code Online (Sandbox Code Playgroud)

定义器

char reserved[NUMBER][4] = {"WOW","LOL","K"}
Run Code Online (Sandbox Code Playgroud)

符号.c

#include "header.h"
void theFunctionWithTheError{
    
       if (reserved[1] == "I love stackoverflow"){ /**THE LINE OF THE ERROR*/
       return;
    }
}
Run Code Online (Sandbox Code Playgroud)

在 sign.c 中,我收到错误Expression must be a pointer to a complete object type for the wordreserved

你建议我做什么?

c ansi-c

1
推荐指数
1
解决办法
63
查看次数

标签 统计

ansi-c ×1

c ×1