There are two kinds of expressions in C:
1.
L value : Expressions
that refer to a memory location is called "lvalue" expression. An
lvalue may appear as either the left-hand or right-hand side of an assignment.
2.
R value : The
term rvalue refers to a data value that is stored at some address in memory. An
rvalue is an expression that cannot have a value assigned to it which means an
rvalue may appear on the right- but not left-hand side of an assignment.
Variables are lvalues and so may appear on the left-hand
side of an assignment. Numeric literals are rvalues and so may not be assigned
and can not appear on the left-hand side. Following is a valid statement:
int g = 20;
But following is not a valid statement and would generate
compile-time error:
10 = 20;
|Footer Menu |
| Introduction | Basic Syntax | Data Types | Variables | Arrays | Constants and Literals |
| Decision Making | Functions | L values and R values | Loops | Nested if statements | Nested loops |
| Nested Switch Statements | Operators | Pointers | Scope Rules |
| Strings | Storage Classes | Structures | Switch Statement |
|Footer Menu |
| Introduction | Basic Syntax | Data Types | Variables | Arrays | Constants and Literals |
| Decision Making | Functions | L values and R values | Loops | Nested if statements | Nested loops |
| Nested Switch Statements | Operators | Pointers | Scope Rules |
| Strings | Storage Classes | Structures | Switch Statement |
No comments:
Post a Comment