×

C Tutorial

C Basics

C Data Types

C Input/Output

C Operators

C Conditional Statements

C Control Statements

C Strings

C Functions

C Arrays

C Structure and Unions

C Pointers

C Preprocessor Directives

C Command-line Arguments

C File Handlings

C Graphics

C Advance Topics

C Tips and Tricks

C Important Topics

C Practice

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);

lvalue

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".

rvalue

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.

C Language Tutorial »





Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.