Given this struct:
struct PipeShm
{
int init;
int flag;
sem_t *mutex;
char * ptr1;
char * ptr2;
int status1;
int status2;
in
Is it possible to declare a pointer to a struct and use initialization with it ?
Yes.
const static struct PipeShm PIPE_DEFAULT = {.init = 0 , .flag = FALSE , .mutex = NULL , .ptr1 = NULL , .ptr2 = NULL ,
.status1 = -10 , .status2 = -10 , .semaphoreFlag = FALSE };
static struct PipeShm * const myPipe = malloc(sizeof(struct PipeShm));
*myPipe = PIPE_DEFAULT;