小编use*_*848的帖子

C中的消息队列:实现2路通信

我是学生和C的初学者.我想在C linux中使用消息队列实现双向通信.我需要两个队列或只需要一个才能完成这项任务吗?

另外我想知道我可以将数据(以代码显示)发送到另一个进程,或者我需要将其声明为字符数组.

typedef struct msg1
{
    int mlen;
    char *data;
}M1;

typedef struct msgbuf
{
    long    mtype;
    M1      *m;
} message_buf;
Run Code Online (Sandbox Code Playgroud)

提前致谢 :)

c linux pointers ipc message-queue

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

c ×1

ipc ×1

linux ×1

message-queue ×1

pointers ×1