#include <stdio.h>
#include <stdlib.h>
#include <sys/ipc.h>
#include <sys/msg.h>
// structure for message queue
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);
   message.msg_type = 1;
   printf("Write Message : ");
   fgets(message.msg, 100, stdin);
   ret = msgsnd(msg_id, &message, sizeof(message), 0); //send message
   printf("Sent message ret is %d message is : %s \n", ret, message.msg);
}
