打印

如何在一个数组里查询,一直查到数组里的内容为0后就推出循环

[复制链接]
338|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
肉坨坨|  楼主 | 2018-7-1 10:48 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
unsigned  char OVERTIME_RECORD[600]={0x41,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x31,
                  0x13,0x04,0x11,0x01,0x01,0x03,
                  0x13,0x04,0x11,0x09,0x09,0x04,
                  0x0a,0xd7,0x0a,0xd7,0x0a,0xd7,0x0a,0xd7,0x0a,0xd7,
                  0x0a,0xd7,0x0a,0xd7,0x0a,0xd7,0x0a,0xd7,0x0a,0xd7,
                  0x41,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x32,
                  0x13,0x04,0x11,0x12,0x12,0x05,
                  0x13,0x04,0x11,0x19,0x19,0x06,
                  0x0a,0xd7,0x0a,0xd7,0x0a,0xd7,0x0a,0xd7,0x0a,0xd7,
                  0x0a,0xd7,0x0a,0xd7,0x0a,0xd7,0x0a,0xd7,0x0a,0xd7,
                  0x41,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x33,
                  0x13,0x04,0x11,0x12,0x13,0x07,
                  0x13,0x04,0x11,0x19,0x22,0x08,
                  0x0a,0xd7,0x0a,0xd7,0x0a,0xd7,0x0a,0xd7,0x0a,0xd7,
                  0x0a,0xd7,0x0a,0xd7,0x0a,0xd7,0x0a,0xd7,0x0a,0xd7,
                  .......
}
for(count=0;count<12;count++)
   {
       for(i=0;i<18;i++)
     {
      send_data_uart1(OVERTIME_RECORD[i+50*count]);
     }
}
如何检测到OVERTIME_RECORD数组里的值为0时,就跳出 for(count=0;count<12;count++)循环,我是用个指针来判断的,后来失败了,请哪位大侠帮我解决一下哦,谢谢。

使用特权

评论回复

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

419

主题

431

帖子

0

粉丝