If I have a structure such as
typedef struct _people {
char *name;
bool *exists;
struct _people **citizens;
} PEOPLE;
How do I go about allocating memory so that people->citizens[0]->name is accessible? I've tried
info->citizens = malloc(sizeof(PEOPLE *)*numbPeople);
However when I try to access info->citizens->name I get the error message in GDB:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000008