You are viewing an older revision! See the latest version

Compiler Error 137

expression must be a modifiable lvalue

An lvalue is value that is allowed to be on the Left hand side of an assignment statement. For example in the following statement, the variable Value is the lvalue as it is on the left hand side of the statement and is having its value modified to be 24.

Value = 24;

This error would be generated for the following example as the if conditional statement contains an assignment which attempts to assign the value of the Value variable to the value 24. Since 24 isn't an lvalue, the error is generated.

#include "mbed.h"

int main() 
{
    int Value = 24;
    
    if (24 = Value)
    {
        printf("Value is equal to 24.\n");
    }
}

All wikipages