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

tiny home security project

hi, I need your help please

I have got C141 errors several times, followings

error C141: syntax error near 'char'
error C141: syntax error near '{'
error C141: syntax error near 'void'

in functions getkey() and column#()

How can I fix these errors?



char getkey()
        {
                if(c1==0 || c2==0 || c3==0)
  {
    if(c1==0)
 {
   column1();
   while(!c1)
                 {
   col=0;  }
 }
    if(c2==0)
 {
  column2();
   while(!c2){
   col=1;}
 }
    if(c3==0)
 {
     column3();
   while(!c3){
   col=2;}
 }
 }


 // return num[row][col];
}

void column1()
{

 r1=r2=r3=r4=1;

 r1=0;
 if(c1==0)
 row=0;

 r1=1;r2=0;
 if(c1==0)
 row=1;

 r1=1;r2=1;r3=0;
 if(c1==0)
 row=2;

 r1=1;r2=1;r3=1;r4=0;
 if(c1==0)
 row=3;

 r1=r2=r3=r4=0;

}


void column2()
{

 r1=r2=r3=r4=1;

 r1=0;
 if(c2==0)
 row=0;

 r1=1;r2=0;
 if(c2==0)
 row=1;

 r1=1;r2=1;r3=0;
 if(c2==0)
 row=2;

 r1=1;r2=1;r3=1;r4=0;
 if(c2==0)
 row=3;

 r1=r2=r3=r4=0;

}


void column3()
{
        r1=r2=r3=r4=1;

 r1=0;

 if(c3==0){
 row=0;}

 r1=1;r2=0;
 if(c3==0){
 row=1;}

 r1=1;r2=1;r3=0;
 if(c3==0){
 row=2;}

 r1=1;r2=1;r3=1;r4=0;
 if(c3==0){
 row=3;}

 r1=r2=r3=r4=0;

}



  • "How can I fix these errors?"

    1. Look at the line identified by the message;

    2. See where the syntax is wrong for the 'C' programming language in general, or the specific Keil C51 variations;

    3. Correct it!

    Simples!

    But note that the error report might be due to some error earlier in the text - which has rendered following text incorrect...

    Also note that the indentation of your code is broken - probably because you've used TAB characters.
    This is best avoided by not using TAB characters - use space characters instead.

    Any decent programmer's editor can be set to insert the appropriate number of space characters when you press the TAB button on the keyboard.
    Most programmer's editors have a facility to convert TABs to spaces.

  • I analyse your program and fix your errors

    you must deposit money in my paypal account before you look at my code

    chaar getkey() { if(c1==0 || c2==0 || c3==0) { if(c1==0) { column1(); while(!c1) { col=0; } } if(c2==0) { column2(); while(!c2){ col=1;} } if(c3==0) { column3(); while(!c3){ col=2;} } } // return num[row][col];
    } void column1()
    { r1=r2=r3=r4=1; r1=0; if(c1==0) row=0; r1=1;r2=0; if(c1==0) row=1; r1=1;r2=1;r3=0; if(c1==0) row=2; r1=1;r2=1;r3=1;r4=0; if(c1==0) row=3; r1=r2=r3=r4=0;}void column2()
    { r1=r2=r3=r4=1; r1=0; if(c2==0) row=0; r1=1;r2=0; if(c2==0) row=1; r1=1;r2=1;r3=0; if(c2==0) row=2; r1=1;r2=1;r3=1;r4=0; if(c2==0) row=3; r1=r2=r3=r4=0;
    } void column3()
    { r1=r2=r3=r4=1; r1=0; if(c3==0){ row=0;} r1=1;r2=0; if(c3==0){ row=1;} r1=1;r2=1;r3=0; if(c3==0){ row=2;} r1=1;r2=1;r3=1;r4=0; if(c3==0){ row=3;} r1=r2=r3=r4=0;}

  • you must deposit money in my paypal account before you look at my code

    chaar

    That sounds fair

  • Nice obfuscation of the code by deliberate non-use of the proper tags!