I have two typedef struct in header file.
typedef struct {
int fallLevel;
unsigned long lastStepTime;
} PlayerFallStruct;
typedef struct {
int id;
char* name;
int x;
int y;
PlayerFallStruct playerFall;
} Client;
I don't know how to access to PlayerFallStruct playerFall. If I use
((PlayerFallStruct*) packetClient->playerFall)->fallLevel = 0;
compiler throws error:
Client.c:46:4: error: cannot convert to a pointer type ((PlayerFallStruct*) packetClient->playerFall)->fallLevel = 0;
Why? Where is a problem? How can I access to my stuct?
(packetClient->playerFall).fallLevel = 0;