C# provides
a large set of operators, which are symbols that specify which operations to
perform in an expression. C# predefines the usual arithmetic and logical
operators, as well as a variety of others as shown in the following table. In
addition, many operators can be overloaded by the user, thus changing their
meaning when applied to a user-defined type.
Operator category
|
Operators
|
Arithmetic
|
+
- * /
%
|
Logical (boolean and bitwise)
|
&
| ^ !
~ && ||
true false
|
String concatenation
|
+
|
Increment, decrement
|
++
--
|
Shift
|
<< >>
|
Relational
|
==
!= < >
<= >=
|
Assignment
|
=
+= -= *=
/= %= &=
|= ^= <<=
>>=
|
Member access
|
.
|
Indexing
|
[]
|
Cast
|
()
|
No comments:
Post a Comment