answersLogoWhite

0

What is lvalue explain with example?

Updated: 12/13/2022
User Avatar

Wiki User

13y ago

Best Answer

left-value: an expression that can be target of assignement.

eg:

array[x+1]->field = 100; # okay

100 = 200; # NOT okay: not lvalue

intvar = 100; # okay

(char *)intvar = "STR"; # NOT okay: not lvalue

*(char **)&intvar = "STR"; okay

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is lvalue explain with example?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions

What is the syntax of increment operator?

Pick one: ++ lvalue lvalue ++ lvalue += value


What is lvalue?

A variable has two associated value with it rvalue and lvalue. 'lvalue' is its location value, that is memory address.


What is the lvalue error?

Most likely it is 'lvalue required' error, examples: 10= x; ++3;


What is the difference between lvalue and rvalue?

A variable is a named storage that can hold any value and has 2 values associated with it namely rvalue and lvalue. 'rvalue' is its data value that is its content and "lvalue" is its location value, that is memory address.


Viva questions of c language?

lvalue


What is Lvalue in c?

An lvalue is an object that can be assigned a value, i.e. it can be on the left side of an equals sign, hence the term lvalue.If the compiler is complaining, you are probably trying to assign a new value to an rvalue, such as an array name or constant.


When will lvalue error occur in c?

When there is no addressable value in program, then compiler will give lvalue error. Lvalue or location value is an address that is stored into while rvalue is the "read" value, ie., value of a constant or the value stored at a location. In the assignment a = 31; we have the lvalue of a used on the left hand side and the integer contant value 31 assigned to this location. In the assignment b = a; we have the rvalue of a (31) used to assign to the lvalue of b . So depending on which side of an assignment, we use the variable a , we get two different behaviors


What is L value error in C?

When there is no addressable value in program, then compiler will give lvalue error. Lvalue or location value is an address that is stored into while rvalue is the "read" value, ie., value of a constant or the value stored at a location. In the assignment a = 31; we have the lvalue of a used on the left hand side and the integer contant value 31 assigned to this location. In the assignment b = a; we have the rvalue of a (31) used to assign to the lvalue of b . So depending on which side of an assignment, we use the variable a , we get two different behaviors


What do you men by precipitation explain by giving an example?

what do u mean by precipitation? explain by giving an example


What are conditional connectives. Explain with an example?

What are conditional connectives? Explain use of conditional connectives with an example


What is bcnf explain with example?

define BCNF. Explain with appropriate example


What represents the left hand side of a binary operator in c plus plus?

The left hand operand of a binary operator must represent a modifiable lvalue: void f (const int x, int y) { x = y; // error -- x is constant lvalue y = x; // ok }