Home » C programming language

What do 'lvalue' and 'rvalue' mean in C/C++?

'lvalue' and 'rvalue' in C/C++ programming language: Learn, in an expression what do 'lvalue' and 'rvalue' mean?

Consider the following expression:

result=(a+b);

An "lvalue" is an expression, variable, constant etc which appears at left-hand side of an assignment operator.

In the expression result =(a+b); - result is an "lvalue".

An "rvalue" is an expression, variable, constant etc which appears at right- hand side of an alignment operator.

In the expression result =(a+b); - (a+b) is an "rvalue";

Consider the following expression, which is also a valid "lvalue" assignment.

((a+b)? a:b) =10;

In the expression, either a or b will be the result of "lvalue" expression and 10 can be assigned in a or b. so this expression is also a valid expression.






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.
Learn PCB Designing: PCB DESIGNING TUTORIAL







Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.