标题: 初学者的问题FLASHLED.C(10): error C141: syntax error near 'z', expected ')' [打印本页]

作者: tnt2007    时间: 2017-6-2 10:11
标题: 初学者的问题FLASHLED.C(10): error C141: syntax error near 'z', expected ')'
源程序:
#include <reg52.h>
#include <intrins.h>
#define uchar unsigned char
#define uint  unsigned int

uchar i;
uchar temp;

void delay (unit z)
{
        uint x,y;
        for(x = z; x > 0; x--)
                for(y = 120; y > 0 ; y--);
}

void main()
{
        temp = 0x7f;
        P1 = temp;
        while(1)
        {
                for(i = 0; i < 8; i++)
                {
                        temp = _cror_(temp,1);
                        P1 = temp;
                        delay(1000);       
                }
        }
}

错误提示:
Build target 'Target 1'
compiling flashled.c...
FLASHLED.C(10): error C141: syntax error near 'z', expected ')'
FLASHLED.C(12): error C141: syntax error near 'x'
FLASHLED.C(12): error C202: 'x': undefined identifier
FLASHLED.C(13): error C202: 'x': undefined identifier
FLASHLED.C(14): error C202: 'y': undefined identifier


作者: tnt2007    时间: 2017-6-2 10:25
知道错哪里了,把帖子删了吧!




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