Lvalues and Rvalues in C#
2013-12-18 17:22
295 查看
一般左值既可以在表达式的左边也可以在右边;
但是右值只能在表达式的右边;
例如:
a = 10; 正确
a=b+10;正确
10 =11; 错误
英文解释如下:
There are two kinds 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.
但是右值只能在表达式的右边;
例如:
a = 10; 正确
a=b+10;正确
10 =11; 错误
英文解释如下:
There are two kinds 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.
相关文章推荐
- Understanding lvalues and rvalues in C and C++
- Combining SqlConnection and SqlCommand in one Class in C#
- Intercept and Manage Windows Originated by Third-party Components Hosted in C# Application
- Professional C# 6 and .NET Core 1.0 - What’s New in C# 6
- Wrox Professional ASP.NET 4 in C# and VB
- 如何使用<Beginning ASP.NET 3.5 in C# and VB>书中的示例代码
- C#: Writing a CookieContainer to Disk and Loading Back In For Use
- C# 中的委托和事件(http://www.tracefact.net/CSharp-Programming/Delegates-and-Events-in-CSharp.aspx)
- Convert string to binary and binary to string in C#
- (.NET) IntelliSense difference of Extension Method name in Statement Completion for VB and C#.
- c# - Create ServiceEndpoint in code and in config
- Asynchronous Programming in C# 5.0 using async and await
- Csharp: Calling Output Parameters and Return Values in ADO.NET
- Just4Fun - Comparaison between const and readonly in C#
- Thread and Sync In C# (C#中的线程与同步)
- The implementation of anonymous methods in C# and its consequences
- Delegates and Events in C# .NET
- Working with PDF files in C# using PdfBox and IKVM
- Convert object to json and json to object in C#
- Exception handling in X++ and C#