11271

#include <sys/types.h>
#include <sys/msg.h>
#include <unistd.h>


struct msg_buf
    {
        int mtype;
        char data[255];
    };
 
int main()
{
        key_t key;
        int msgid;
        int ret;
        struct msg_buf msgbuf;
        struct msg_buf msgbuf1;
        struct msg_buf msgbuf2;
        struct msg_buf msgbuf3;
 
        key=ftok("/tmp/2",'a');
        printf("key =[%x]\n",key);
        msgid=msgget(key,IPC_CREAT|0666); /*通过文件对应*/


        if(msgid==-1)
        {
                printf("create error\n");
                return -1;
        }
 
        msgbuf1.mtype = 1;
        strcpy(msgbuf1.data,"test haha1");
        msgbuf2.mtype = 2;
        strcpy(msgbuf2.data,"test haha2");
        msgbuf3.mtype = 3;
        strcpy(msgbuf3.data,"test haha3");


        ret=msgsnd(msgid,&msgbuf1,sizeof(msgbuf1.data),IPC_NOWAIT);
        ret=msgsnd(msgid,&msgbuf2,sizeof(msgbuf2.data),IPC_NOWAIT);
        ret=msgsnd(msgid,&msgbuf3,sizeof(msgbuf3.data),IPC_NOWAIT);
        if(ret==-1)
        {
                printf("send message err\n");
                return -1;
        }
 
        memset(&msgbuf,0,sizeof(msgbuf));
        ret=msgrcv(msgid,&msgbuf,sizeof(msgbuf.data),2,IPC_NOWAIT);
        if(ret==-1)
        {
                printf("recv message err\n");
                return -1;
        }
        printf("recv msg =[%s]\n",msgbuf.data);
 
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
y x1 x2 x3 x4 x5 1159.93 571.7 4545.6 570 42361 910.9 1175.79 629.89 4891.6 735.3 43725 961 1212.33 700.02 5323.4 771.3 45295 1230.4 1366.95 775.59 5962.7 860.1 46436 1430.1 1642.86 947.35 7208.1 1201 48197 1832.9 2004.82 2040.79 9016 2066.7 49873 2543.2 2122.01 2090.73 10275.2 2580.4 51282 3120.6 2199.35 2140.36 12058.6 3084.2 52783 3791.7 2357.24 2390.47 15042.8 3821.8 54334 4753.8 2664.9 2727.4 16992.3 4155.9 55329 4410.4 2937.1 2821.86 18667.8 5560.1 64749 4517 3149.48 2990.17 21781.5 7225.8 65491 5594.5 3483.37 3296.91 26923.5 9119.6 66152 8080.1 4348.95 4255.3 35333.9 11271 66808 13072.3 5218.1 5126.88 48197.9 20381.9 67455 17042.1 6242.2 6038.04 60793.7 23499.9 68065 20019.3 7407.99 6909.82 71176.6 24133.8 68950 22913.5 8651.14 8234.04 78973 26967.2 69820 24941.1 9875.95 9262.8 84402.3 26857.7 70637 28406.2 11444.08 10682.58 89677.1 29896.3 71394 29854.7 13395.23 12581.51 99214.6 39274.2 72085 32917.7 16386.04 15301.38 109655.2 42183.6 72797 37213.5 18903.64 17636.45 120332.7 51378.2 73280 43499.9 21715.25 20017.31 135822.8 70483.5 73736 55566.61 26396.47 24165.68 159878.3 95539.1 74264 70477.43 31649.29 28778.54 184937.4 116921.8 74647 88773.61 38760.2 34804.35 216314.4 140974 74978 109998.16 51321.78 45621.97 265810.3 166863.7 75321 137323.94 61330.35 54223.79 314045.4 179921.5 75564 172828.4 68518.3 59521.59 340902.8 150648.1 75828 224598.77 83101.51 73210.79 401512.8 201722.1 76105 251683.77 利用这一组数据用逐步回归法进行回归建模,并用par(函数做回归诊断)
最新发布
05-28

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值