标题: code.c(6): error C129: missing ';' before 'table' 关于温度监测 [打印本页]

作者: 奇妙苏打饼    时间: 2020-5-1 17:22
标题: code.c(6): error C129: missing ';' before 'table' 关于温度监测
#include<reg51.h>
#define uchar unsigned char
#define uint unsigned
int warn_l2 = 50;
int warn__shi=0;
uchar cod table[] = {
                                        0x3f,0x06,0x5b,0x4f,
                                        0x66,0x6d,0x7d,0x07,
                                        0x7f,0x6f,
                                        0xbf,0x86,0xdb,0xcf,
                                        0xe6,0xed,0xfd,0x87,
                                        0xff,0xef,
                                        0x40
                                                };
void delay(int z)
{       
        int a,b;
        for(a = 0;a < z ;a++)
                for(b = 0;b < 120; b++);
}
void  display(uchar num , uchar dat)
{
        uchar i;
        dula = 0;
        wela = 0;
        wela = 1;
        i = 0x00;
        i = i | (~(((0x01)<<(num))));
        P0 = i;
        wela = 0;
        dula = 1;
        P0 = table[dat];
        dula = 0;
        P0 = 0xff;
        dula = 0;
        delay(3);
}
void dis_temp(int t)
{
        uchar i;
        i = t100;
        display(1,i);
        i = t%10010;
        display(2,i+10);
        i = t%100%10;
        display(3,i);
        delay(5);

}

code.c(6): error C129: missing ';' before 'table'
不知道要怎么解决求助各位大神


作者: 黄youhui    时间: 2020-5-1 21:55
uchar cod table[21] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07, 0x7f,0x6f,0xbf,0x86,0xdb,0xcf,0xe6,0xed,0xfd,0x87,0xff,0xef,0x40};你为了让数组看起来整齐用了很多空格,把空格删了

$83D[QU7P2@665U()H~LFQD.png (20.96 KB, 下载次数: 93)

$83D[QU7P2@665U()H~LFQD.png

作者: xxpp2011    时间: 2020-5-1 22:17
uchar code table[]
code拼错了
作者: csmyldl    时间: 2020-5-1 22:27
table前的cod改为code
作者: 罗程峰8200    时间: 2020-5-2 00:57
看来问题已经解决了
作者: 奇妙苏打饼    时间: 2020-5-2 12:49
解决了 谢谢各位大佬




欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1