1 Reply Latest reply on Dec 3, 2017 12:37 AM by MartyG

    What the meanings of this error "lvalue required as left operand of assignment"?

    Amie_coolman93

      error 2.JPG

      *Because I want to use DDR mode or (controller->gpio_swporta_ddr = cfg->direction;) like code below:

      lcd.JPG

      *When I change the code as above to C1000 format, it produce an error like the first image :

      1.JPG2.JPG

       

      *Please help me.

      MartyGMichelleC_IntelqikiAlexT_Intelctan94x_intel

       

       

       

        • 1. Re: What the meanings of this error "lvalue required as left operand of assignment"?
          MartyG

          Somebody explained the lvalue error like this:

           

          **************

           

          An "lvalue" is something that can have the result of any computation assigned to it - it's pretty much some location in memory where you can put values.  The statement "int abc;" declares and integer variable "abc", which can be an lvalue.

           

          The address of abc - "&abc" - is not an lvalue, because you can't assign a result to that - the address of the variable is the address.  You can assign something to where that address points to by using the "*" operator, so "*( &abc )" is actually an lvalue.  The integer constant "3" is not an lvalue.