This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Error 141 and 202

im fairly new to uc programming and im trying to write a lcd interfacing program for at89c2051.the function here accepts two strings and is used to display it on lcd. Im getting an error 141 and 202 in the second for loop. and when i delete the second for loop the error get transferred to the first for loop.
What should i do . please help.??

void lcddata(unsigned char* l1 ,unsigned char* l2)
{ int value;

for( int i=0; char[i]!=0; i++)

{ lcdready();

value= l1[i];

ldata = value;

rs=1;

rw=0;

en=1;

msdelay(1);

en=0;

}

for( unsigned int j=0; char[j]!=0; j++) //error 141 : syntax error near ')'

{ lcdready();

value= l2[j]; //error 202 : 'j' unidentified identifier

ldata = value;

rs=1;

rw=0;

en=1;

msdelay(1);

en=0;

}
return;

}

Parents
  • On my google page, the 3rd-4th link showed the forums on which the same questions were already asked. Anyways....

    Let me elaborate this for you...

    'j' --> is the identifier, which is not defined in your code!!!

    eg of defining a variable:
    int value; //(as per your code)
    so the value is a identifier of the type int. the compiler allocates 2bytes of memory for variable 'value' in ram (not going into the details of which segment of ram).

    where in your code have you defined 'j'??
    BTW, i can't even see the definition of 'i'!!

Reply
  • On my google page, the 3rd-4th link showed the forums on which the same questions were already asked. Anyways....

    Let me elaborate this for you...

    'j' --> is the identifier, which is not defined in your code!!!

    eg of defining a variable:
    int value; //(as per your code)
    so the value is a identifier of the type int. the compiler allocates 2bytes of memory for variable 'value' in ram (not going into the details of which segment of ram).

    where in your code have you defined 'j'??
    BTW, i can't even see the definition of 'i'!!

Children