Home  >  Article  >  Backend Development  >  What are rvalues ​​and lvalues ​​in C#?

What are rvalues ​​and lvalues ​​in C#?

WBOY
WBOYforward
2023-08-26 19:33:091329browse

C# 中的右值和左值是什么?

The following are the types of expressions in C# -

  • lvalue - Expressions that are lvalues ​​can be displayed Is the left or right side of the assignment.

  • rvalue - An expression that is an rvalue can appear on the right-hand side, but not on the left-hand side of a right-hand assignment.

Variables are lvalues, so they may appear on the left side of an assignment. Numeric literals are rvalues, so they cannot be assigned, nor can they appear on the left-hand side.

This is a valid C# statement -

int a = 100:

The above is the detailed content of What are rvalues ​​and lvalues ​​in C#?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete
Previous article:Private variables in C#Next article:Private variables in C#