IPC

You shouldn't be sending a pointers to another process, they have no meaning (or point to something very different) in another process' address space.
Message queues aren't great for unbounded data like variable length strings. Change your pointer to a fixed length char array sufficiently big to hold the largest string and copy your string into the array before writing the queue. Or use another type of IPC such as domain socket.

posted @ 2017-11-29 21:49  elseliving的记录  阅读(85)  评论(0编辑  收藏  举报