I try to use POSIX Message Queue API and in the doc it says that:
#include <mqueue.h> int mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio);
The mq_send() function shall add the message pointed to by the argument msg_ptr to the message queue specified by mqdes. The msg_len argument specifies the length of the message, in bytes, pointed to by msg_ptr. The value of msg_len shall be less than or equal to the mq_msgsize attribute of the message queue, or mq_send() shall fail.
As seen in the prototype of the function mq_send, the message element is represented by const char *msg_ptr. But what will it be if I need to send a message which is not a const char*, for example a structure object?
I wish if I explained my problem clearly. If not, I can try to explain more.
Thanks in advance.