I am making a C program, which needs to access a struct array in a struct.
The definition looks like below
struct def_world
{
bool lock;
char tilemap;
def_tile tile[100][100];
struct def_tile
{
bool lock;
char kind;
def_obj * obj;
void * evt;
};
struct def_obj
{
bool lock;
int indexOfTable;
bool frozen;
char x,y;
char kind;
char face;
char * msg;
char * ip;
};
in the main function, I want to access world's tile[3][3]
's obj's face.
I initialize world as
def_world world={0,};
but the following lines make errors
world.tile[3][3].obj=newobj();//newobj() returns def_obj type
world.tile[3][3].obj->face;
any idea how to access obj's face?