c - mmap and struct (incompatible type error struct to void *) -
i'm getting error: error: incompatible types when assigning type ‘struct sharedmem’ type ‘void *’ when trying mmap struct sharedmemory. here's i'm trying do: //struct each card typedef struct card{ char c[3]; //card char s; //suit } card; //struct player information typedef struct player{ int num; char* nickname; char* fifo_p; struct card* hand; } player; //struct sharedmemory typedef struct sharedmem{ unsigned int nplayers; unsigned int dealer; struct player *players; unsigned int roundnumber; unsigned int turn; struct card *tablecards; } sharedmem; then have function does: int createsharedmemory(char* shmname,int nplayers){ int shmfd; char shmname[100]={'\0'}; char *ps; ps=&shmname[0]; strcat(ps,"/"); strcat(ps,shmname); // name = /shmname shmfd = shm_open(shmname,o_rdwr,0755); if (shmfd<0){ if (errno==2){ //file or directory not exist (shared ...