void nihao() { <------ when i debug, y there my brace turn red? tmp=5; if (count==tmp){ P0=0x00; P2=0X00;} if (count==tmp+2){ //n P0=0xfe; P2=0x03;} if (count==tmp+4){ P0=0x0c; P2=0X00;} if (count==tmp+6){ P0=0x18; P2=0x00;} if (count==tmp+8){ P0=0x30; P2=0x00;} if (count==tmp+10){ P0=0x60; P2=0x00; if (count==tmp+12){ P0=0xc0; P2=0X00;} if (count==tmp+14){ P0=0x80; P2=0x01;} if (count==tmp+16){ P0=0xfe; P2=0x03;} if (count==tmp+18){ P0=0x00; P2=0x00;} if (count==tmp+20){ //i P0=0xfe; P2=0x03;} if (count==tmp+22){ P0=0x00; P2=0x00;} if (count==tmp+24){ //h P0=0xfe; P2=0x03;} if (count==tmp+26){ P0=0x20; P2=0x00;} if (count==tmp+28){ P0=0x20; P2=0x00;} if (count==tmp+30){ P0=0x20; P2=0x00;} if (count==tmp+32){ P0=0x20; P2=0x00;} if (count==tmp+34){ P0=0x20; P2=0x00;} if (count==tmp+36){ P0=0x20; P2=0x00;} if (count==tmp+38){ P0=0xfe; P2=0x03;} if (count==tmp+40){ P0=0x00; P2=0x00;} if (count==tmp+42){ //a P0=0xfe; P2=0x03;} if (count==tmp+44){ P0=0xfe; P2=0x03;} if (count==tmp+46){ P0=0xfe; P2=0x03;} if (count==tmp+48){ P0=0xc6; P2=0x00;} if (count==tmp+50){ P0=0xc6; P2=0x00;} if (count==tmp+52){ P0=0xc6; P2=0x00;} if (count==tmp+54){ P0=0xfe; P2=0x03;} if (count==tmp+56){ P0=0xfe; P2=0x03;} if (count==tmp+58){ P0=0xfe; P2=0x03;} if (count==tmp+60){ P0=0x00; P2=0x00;} if (count==tmp+62){ //o P0=0xfe; P2=0x03;} if (count==tmp+64){ P0=0x02; P2=0x02;} if (count==tmp+66){ P0=0x02; P2=0x02;} if (count==tmp+68){ P0=0x02; P2=0x02;} if (count==tmp+70){ P0=0xfe; P2=0x03;} if (count==tmp+72){ P0=0x00; P2=0x00;} } void welcome() //display welcome <---- error show at this line {
What do you mean by, "when i debug"?
If the code fails to compile due to a syntax error, you have nothing to run in the debugger!
Would the code not be a whole lot clearer as a switch statement?
Why even a switch statement?
It seems that the comparisons are count==(tmp+2*n).
So why not separate out the non-existing odd cases (count==(tmp+2*n+1)) and then have a lookup table? That would greatly reduce the code size, unless the compiler happens to have noticed that regularity already.
the C standard for void nihao() is void nihao(void)
Erik
He probably meant it to be:
int nihao(void);
and it should surely return the constant hao_ni_ne.