Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Announcements
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9882 Discussions

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

MRosn
Beginner
2,256 Views

*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
601 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