Community
cancel
Showing results for 
Search instead for 
Did you mean: 
MRosn
Beginner
2,027 Views

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

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

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

*Please help me.

MartyGMichelleC_IntelqikiAlexT_Intelctan94x_intel

0 Kudos
1 Reply
MartyG
Honored Contributor III
372 Views

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.

Reply