欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: Keil C語言編譯錯誤C202 C231代碼未定義 [打印本頁]

作者: 1739813381    時間: 2021-9-1 22:20
標題: Keil C語言編譯錯誤C202 C231代碼未定義
#include<reg52.h>
#define uint uigned int
#define uint unsigned int
#define uchar unsigned charvoid delay(uint);
sbit D0=P1^0;
sbit D1=P1^1;
sbit D2=P1^2;
sbit D3=P1^3;
sbit D4=P1^4;
sbit D5=P1^5;
sbit D6=P1^6;
sbit D7=P1^7;
void main()   
{   
while(1)        
{        
D0=0;        
delay(600);        
D1=0;        
delay(600);        
D2=0;        
delay(600);        
D3=0;        
delay(600);        
D4=0;        
delay(600);        
D5=0;        
delay(600);        
D6=0;        
delay(600);        
D7=0;        
delay(600);            
}   
}
void
delay(uint z)   
{   
uint x,y;   
for(x=100;x>0;x--)        
{        
for(y=z;y>0;y--)            
{            
}        
}   
}
P.C(41): error C202: 'y': undefined identifier
P.C(45): error C231: 'delay': redefinition
p.c - 8 Error(s), 2 Warning(s).




作者: wulin    時間: 2021-9-2 06:02
抄錯了
#include<reg52.h>
//#define uint uigned int
#define uint unsigned int
#define uchar unsigned char
void delay(uint);
作者: xuyaqi    時間: 2021-9-2 07:10
#define uint uigned int 應該 #define uint unsigned int,uigned 錯。
作者: zyluglugl    時間: 2021-9-2 07:28
xuyaqi 發表于 2021-9-2 07:10
#define uint uigned int 應該 #define uint unsigned int,uigned 錯。

可以呀!這C學到家了。
作者: 188610329    時間: 2021-9-2 20:06
#define uchar unsigned charvoid delay(uint);
這里少了回車,
#define uchar unsigned char
void delay(uint);
就可以了,

另外,最好用typedef 不要用 define (僅僅建議)
作者: 1739813381    時間: 2021-9-4 20:56
wulin 發表于 2021-9-2 06:02
抄錯了
#include
//#define uint uigned int

謝謝總工
作者: 1739813381    時間: 2021-9-4 20:57
188610329 發表于 2021-9-2 20:06
#define uchar unsigned charvoid delay(uint);
這里少了回車,
#define uchar unsigned char

謝謝您的建議  
作者: 1739813381    時間: 2021-9-4 21:06
wulin 發表于 2021-9-2 06:02
抄錯了
#include
//#define uint uigned int

謝謝您 現在可以




歡迎光臨 (http://m.raoushi.com/bbs/) Powered by Discuz! X3.1