#include <stdio.h>
#include <stdlib.h>
#include <sys/ipc.h>
#include <sys/msg.h>
// Define message queue structure
struct msg_buffer {
   long msg_type;
   char msg[100];
} message;
main(int argc,char *argv[]) {
   key_t my_key;
   int msg_id;
   int ret;
   my_key = atoi(argv[1]); //create unique key
   msg_id = msgget(my_key, 0666 | IPC_CREAT); //create message queue and return id
   printf("Message id: %d\n", msg_id);
   ret = msgrcv(msg_id, &message, sizeof(message), 1, 0); //used to receive message
   // display the message
   printf("Received Message len is %d, message is : %s \n", ret, message.msg);
   //msgctl(msg_id, IPC_RMID, NULL); //destroy the message queue
   return 0;
}
