level 8
TEXT1.C(33): error C267: 'delay': requires ANSI-style prototype,怎样解决?
2014年04月05日 05点04分
1
level 8
#include<reg52.h>
sbit duan_latch=P2^2;
sbit wei_latch=P2^3;
void delay();
main()
{
unsigned char weima[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
unsigned char duanma[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
unsigned int i;
while(1)
{
for(i=0;i<8;i++)
{
P1=weima[i];
wei_latch=1;
duan_latch=0;
P1=duanma[i];
duan_latch=1;
duan_latch=0;
delay(555);
}
}
}
void delay(unsigned int j)
{
unsigned int i=0;
for(i=0;i<j;i++);
}
2014年04月05日 07点04分
7
level 12
前置申明加上参数试试,我为了方便,一般前面写所有的子函数,主函数最后写。
2014年04月05日 07点04分
8
还真的是也。。。。。谢了哈
2014年04月05日 09点04分