为什么用C语言编写代码,可是却出现了很多错误?能帮忙看看哪里错了吗,怎么修改
#include<reg52.h>#include<intrins.h>#defineucharunsignedchar#defineuintunsignedintuch...
#include<reg52.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
uchar temp;
void delay(uint z)
void main()
{
temp=0xfe;
P1=temp;
while(1)
{
delay(1000);
temp=_crol_(temp,1);
P1=temp;
}
}
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
下面是出现的错误
15.C(1): warning C500: LICENSE ERROR (R208: RENEW LICENSE ID CODE (LIC))
15.C(8): error C132: 'main': not in formal parameter list
15.C(8): error C141: syntax error near '{'
15.C(9): error C136: 'temp': 'void' on variable
15.C(9): error C244: 'temp': can't initialize, bad type or class
15.C(9): error C136: 'temp': 'void' on variable
15.C(9): error C132: 'temp': not in formal parameter list
15.C(10): error C244: 'P1': can't initialize, bad type or class
15.C(10): error C132: 'P1': not in formal parameter list
15.C(11): error C141: syntax error near 'while'
15.C(11): error C141: syntax error near '1'
15.C(13): error C141: syntax error near '1000'
15.C(14): error C231: 'temp': redefinition
15.C(14): error C247: non-address/-constant initializer
15.C(15): error C231: 'P1': redefinition
15.C(15): error C247: non-address/-constant initializer
15.C(15): error C231: 'P1': redefinition
15.C(16): error C141: syntax error near '}'
15.C(19): error C231: 'delay': redefinition
15.C(23): error C231: 'delay': redefinition 展开
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
uchar temp;
void delay(uint z)
void main()
{
temp=0xfe;
P1=temp;
while(1)
{
delay(1000);
temp=_crol_(temp,1);
P1=temp;
}
}
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
下面是出现的错误
15.C(1): warning C500: LICENSE ERROR (R208: RENEW LICENSE ID CODE (LIC))
15.C(8): error C132: 'main': not in formal parameter list
15.C(8): error C141: syntax error near '{'
15.C(9): error C136: 'temp': 'void' on variable
15.C(9): error C244: 'temp': can't initialize, bad type or class
15.C(9): error C136: 'temp': 'void' on variable
15.C(9): error C132: 'temp': not in formal parameter list
15.C(10): error C244: 'P1': can't initialize, bad type or class
15.C(10): error C132: 'P1': not in formal parameter list
15.C(11): error C141: syntax error near 'while'
15.C(11): error C141: syntax error near '1'
15.C(13): error C141: syntax error near '1000'
15.C(14): error C231: 'temp': redefinition
15.C(14): error C247: non-address/-constant initializer
15.C(15): error C231: 'P1': redefinition
15.C(15): error C247: non-address/-constant initializer
15.C(15): error C231: 'P1': redefinition
15.C(16): error C141: syntax error near '}'
15.C(19): error C231: 'delay': redefinition
15.C(23): error C231: 'delay': redefinition 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励20(财富值+成长值)
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询