Given this struct:
struct PipeShm
{
int init;
int flag;
sem_t *mutex;
char * ptr1;
char * ptr2;
int status1;
int status2;
in
First you need to allocate memory for the pointer as below:
myPipe = malloc(sizeof(struct PipeShm));
Then, you should assign values one by one as below:
myPipe->init = 0;
myPipe->flag = FALSE;
....
Please note that for each individual pointer inside the structure, you need allocate memory seperately.