c语言程序问题
程序如下,
#include <reg51.h>
#include <stdio.h>
#define uint unsigned int
#define uchar unsigned char
void delay(void);
uchar keyscan();
void main(void)
{
uchar key;
while(1)
{key=keyscan();
delay();}
}
void delay(void)
{uchar i;
for(i=0;i <200;i++){}
}
uchar keyscan(void)
{
uchar code_h;
uchar code_l;
p1 =0xf0;
if((p1&0xf0)!=0xf0)
{
delay();
if((p1&0xf0)!=0xf0)
{
code_h=0xfe;
while((code_h&p1)!=0xf0)
{
p1=code_h;
if((p1&0xf0)!=0xf0)
{
code_l=(p1&0xf0|0x0f);
return((~code_h)+(~code_l));
}
else
code_h=(code_h < <1)|0x01;
}
}
}
return(0);
}
编译后的信息是:
Build target 'Target 1'
compiling prog.c...
PROG.C(22): error C141: syntax error near '='
PROG.C(23): error C190: '&': not an lvalue
PROG.C(26): error C190: '&': not an lvalue
PROG.C(29): error C141: syntax error near ')'
PROG.C(29): error C141: syntax error near '!='
PROG.C(29): error C141: syntax error near ')'
PROG.C(32): error C190: '&': not an lvalue
PROG.C(34): error C190: '&': not an lvalue
Target not created
为什么会这样呢?????
发表时间:2004年1月2日13:32:29