我typedef struct
在头文件中有两个。
typedef struct {
int fallLevel;
unsigned long lastStepTime;
} PlayerFallStruct;
typedef struct {
int id;
char* name;
int x;
int y;
PlayerFallStruct playerFall;
} Client;
我不知道如何访问PlayerFallStruct playerFall
. 如果我使用 ((PlayerFallStruct*) packetClient->playerFall)->fallLevel = 0;
编译器抛出错误:
Client.c:46:4: 错误:无法转换为指针类型 ((PlayerFallStruct*) packetClient->playerFall)->fallLevel = 0;
为什么?哪里有问题?如何访问我的stuct
?