求大家看一下什么问题,红色两行换一下位置为啥报错
时间:10-02
整理:3721RD
点击:
#include <reg51.h>
#include <intrins.h>
//#define uint unsigned int
//#define uchar unsigned char
#define liushuideng P0
void delay(int z)
{
int x,y;
for(x=z;x--;x>0)
for(y=100;y--;y>0);
}
void main()
{
int m;
liushuideng = 0x01;
while(1)
{
for(m=0;m<7;m++)
{
liushuideng = _crol_(liushuideng,1);
delay(500);
}
for(m=0;m<7;m++)
{
liushuideng = _cror_(liushuideng,1);
delay(500);
}
}
}
#include <intrins.h>
//#define uint unsigned int
//#define uchar unsigned char
#define liushuideng P0
void delay(int z)
{
int x,y;
for(x=z;x--;x>0)
for(y=100;y--;y>0);
}
void main()
{
int m;
liushuideng = 0x01;
while(1)
{
for(m=0;m<7;m++)
{
liushuideng = _crol_(liushuideng,1);
delay(500);
}
for(m=0;m<7;m++)
{
liushuideng = _cror_(liushuideng,1);
delay(500);
}
}
}
keil里面要求一切局部变量要定义在其他语句之前!
变量声明要在其他语句的前面
只有C++,C#可以随时随地声明变量,但是也得在使用前声明;
如果是C,函数内部只能在开头部位声明变量,中间不能有执行语句
谢谢兄台,,,,
谢谢兄台,,,,
谢谢兄台。
编译环境要求的