
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
What are rvalue and lvalue in C#?
The following are the types of expressions in C# −
lvalue − An expression that is an lvalue may appear as either the left-hand or right-hand side of an assignment.
rvalue − An expression that is an rvalue may appear on the right- but not left-hand side of an assignment.
Variables are lvalues and hence they may appear on the left-hand side of an assignment. Numeric literals are rvalues and hence they may not be assigned and cannot appear on the left-hand side.
Here is a valid C# statement −
int a = 100:
- Related Articles
- lvalue and rvalue in C
- What are auto and decltype in C++?
- What are Lvalues and Rvalues in C++?
- What are Aggregates and PODs in C++?
- What are signed and unsigned keywords in C++?
- What are increment (++) and decrement (--) operators in C#?
- What are Base and Derived Classes in C#?
- What are __FILE__, __LINE__, and __FUNCTION__ in C++
- What are C operators and Punctuators?
- What are the differences between bitwise and logical AND operators in C/C++
- What are variables and types of variables in C++?
- What are local variables and global variables in C++?
- What are cin, cout and cerr streams in C++?
- What are string and String data types in C#?
- What are reading and writing characters in C language?

Advertisements