
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
lvalue and rvalue in C
An lvalue (locator value) represents an object that occupies some identifiable location in memory (i.e. has an address).
rvalues are defined by exclusion. Every expression is either an lvalue or an rvalue, so, an rvalue is an expression that does not represent an object occupying some identifiable location in memory.
For example, An assignment expects an lvalue as its left operand, so the following is valid:
int i = 10; But this is not: int i; 10 = i;
This is because i has an address in memory and is a lvalue. While 10 doesn't have an identifiable memory location and hence is an rvalue. So assigning the value of i to 10 doesn't make any sense.
- Related Articles
- What are rvalue and lvalue in C#?
- Foreach in C++ and C#
- Comma in C and C++
- Loops in C and C++
- INT_MAX and INT_MIN in C/C++ and Applications
- isalpha() and isdigit() in C/C++
- nextafter() and nexttoward() in C/C++
- Undefined Behaviour in C and C++
- rand() and srand() in C/C++
- Floating Point Operations and Associativity in C, C++ and Java
- exit(), abort() and assert() in C/C++
- strdup() and strdndup() in C/C++\n
- Name Mangling and extern “C” in C++
- Difference between Structures in C and C++
- Alternating Vowels and Consonants in C/C++

Advertisements