mq_receive() example

can anyone provide me with a simple example of mq_receive().

ssize_t mq_receive(mqd_t mqdes, char *buf, size_t len, unsigned *prio)
takes the oldest message with the highest priority from mqdes into buf. prio, if not NULL, is filled with the priority of the given message.
Returns the length of the message received, or -1 on error.