请求高手帮助这流水灯的程序明明正确啊 为啥编译总是错误啊 我是菜鸟 急求帮助 麻烦了
#include
#define uint unsigned int
#define uchar unsigned char
uchar code table[]={0xfe,0xfd,0xfb,0xf7,
0xef,0xdf,0xbf,0x7f}
void delay(uint)
void delay(uint z)
{
uint x,y;
for(x=0;x
for(y=0;y<60;y++);
}
void main()
{
uchar i;
while(1)
for(i=0;i<8;i++)
{
P0=table;
delay(60);
}
}
错误信息(用的是keil uvision2 软件)
Build target 'Target 1'
compiling lesson1_4.c...
LESSON1_4.C(6): error C141: syntax error near 'void'
LESSON1_4.C(7): error C141: syntax error near 'void'
LESSON1_4.C(8): error C141: syntax error near '{'
LESSON1_4.C(10): error C141: syntax error near 'for'
LESSON1_4.C(10): error C141: syntax error near '=', expected ')'
LESSON1_4.C(10): error C129: missing ';' before '<'
Target not created
请教各位高手帮忙
这样写
for(x=0;x for(y=0;y<60;y++);
这名有毛病
应写成
for(x=0;x<60;x++)
{
for(y=0;y<60;y++)
;
}
http://shop34182318.taobao.com/
https://shop436095304.taobao.com/?spm=a230r.7195193.1997079397.37.69fe60dfT705yr
回复 沙发 ddllxxrr 的帖子
我发帖子的时候 写错了 即便是这样写也会出现上面的这种错误提示
Build target 'Target 1'
compiling lesson1_4.c...
LESSON1_4.C(6): error C141: syntax error near 'void'
LESSON1_4.C(7): error C141: syntax error near 'void'
LESSON1_4.C(8): error C141: syntax error near '{'
LESSON1_4.C(10): error C141: syntax error near 'for'
LESSON1_4.C(10): error C141: syntax error near '=', expected ')'
LESSON1_4.C(10): error C129: missing ';' before '<'
Target not created
请教各位高手帮忙
哦 终于找到毛病了 原来是数组的后面少了一个分号 呵呵呵 谢了