给我带来问题的结构代码是
typedef struct gamer
{
char name[MAXNAME];
Cell token;
unsigned score;
} Gamer;
枚举是
typedef enum cell
{
BLANK, RED, CYAN
} Cell;
当我尝试设置struct Cell
成员的值时,我使用此代码;
gamer1->Cell = RED;
然而,在编译它时会给我这个错误;
error: 'Gamer' has no member named 'Cell'". Thanks in advanced.
答案 0 :(得分:7)
你应该gamer1->token = RED;
token
是结构的成员,而不是Cell
。