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

Conversion problem

uint64_t build_table ( int32_t myparameter ) {

 if ( myparameter == 7 ) {
   return BOOL_TRUE;
 }
 else if
 (myparameter == 29 ) {
   return BOOL_FALSE;
  }
  else
 {
   return 23;
 }

 return 5;
}


Parents
  • One if can only have one else.

    And anything that doesn't match the if will (!) enter the else.

    Your code have an extra else that isn't matched by a previous if.

    And you then suddenly compare your int-valued parameter with the address the compiler/linker used to store the text string "0".

    A good programming book and some quality time reading it is the best investment - you will just waste time doing trial-by-error programming.

Reply
  • One if can only have one else.

    And anything that doesn't match the if will (!) enter the else.

    Your code have an extra else that isn't matched by a previous if.

    And you then suddenly compare your int-valued parameter with the address the compiler/linker used to store the text string "0".

    A good programming book and some quality time reading it is the best investment - you will just waste time doing trial-by-error programming.

Children