if(c>b)报错
# include <reg52.h># define uint unsigned
# define uchar unsigned char
sbit c = P0^0;
sbit d = P0^1;
sbit led = P0^2;
uchar code table1[] = {0x01, 0x02, 0x04, 0x08};
uchar code table2[] = {0x08, 0x04, 0x02, 0x01};
void delay(uint x)
{
uchar i;
while(x --)
{
for(i = 80; i > 0; i --);
}
}
void main()
{
EA = 1;
while(1)
{
if(c == d)
{
led = 0;
delay(10);
}
else
{
if (c > d)
EX0 = 1;
else
EX1 = 1;
}
}
}
void int0() interrupt 0
{
uchar a;
for(a = 0; a < 4; a ++)
{
P3 = table1[a];
delay(10);
}
}
void int1() interrupt 2
{
uchar b;
for(b = 0; b < 4; b ++)
{
P3 = table2[b];
delay(10);
}
}
这里:if(c>b)这一行提示'>' bad operand type.怎么回事啊?
谢谢~