#include"stdlib.h"
void delay(unsigned char j)
{
while(--j){
j=j;
}
}
void main()
{
unsigned char i=0;
i=5000;
delay(i);
void delay(unsigned char j)
{
while(--j){
j=j;
}
}
void main()
{
unsigned char i=0;
i=5000;
delay(i);
}
vc6.0上测试:
delay函数参数是unsigned char 型,实参是5000,比255大,因为对于unsigned char 255+1=0,而5000中有19个256(5000/256=19),所以5000-19*256=136,即
delay(5000)相当于delay(136);