C # Operator Overview

Source: Internet
Author: User
Operator category Operator

Basic

X. y

F (x)

A [x]

X ++

X --

New

Typeof

Checked

Unchecked

->

RMB 1

+

-

!

~

++ X

-- X

(T) x

True

False

&

Sizeof

Multiplication

*

/

%

Addition

+

-

Transform

<

>

Link and type detection

<

>

<=

> =

Is

As

Equal

=

! =

Logic "and"

&

Logic XOR

^

Logic "or"

|

Condition and

&&

Condition or

|

Conditional operation

? :

Assignment

=

+ =

-=

* =

/=

% =

& =

| =

^ =

<=

>>=

??

C # Process Control-boolean operator-C #
Branch-execute code loops conditionally-execute the same statement repeatedly (repeated) boolean logic: Boolean comparison requires the use of Boolean comparison operators (also known as Relational operators) Boolean logical operators are as follows: boolean logical operator: =; Class: Binary; example expression: var1 = var2 = var3; Result: If var2 is equal to var3, the value of var1 is true; otherwise, the value is false; boolean logical operator :! =; Category: Binary; example expression: var1 = var2! = Var3; Result: If var2 is not equal to var3, the value of var1 is true; otherwise, it is false. boolean logical operator: <; Class: Binary; example expression: var1 = var2 <var3; result: If var2 is smaller than var3, the value of var1 is true; otherwise, it is false; Boolean logical operator >;class: Binary; example expression: var1 = var2> var3; Result: if var2 is greater than var3, the value of var1 is true, otherwise false. boolean logical operator: <=; Class: Binary; example expression: var1 = var2 <= var3; Result: if var2 is less than or equal to var3, the value of var1 is true, otherwise false; Boolean logical operator >=; class: Binary; example expression: var1 = var2> = var3; Result: if var2 is greater than or equal to var3, the value of var1 is true; otherwise, the value is false. boolean logical operator :!; Category: mona1; example expression: var1 =! Var2; Result: If var2 is false, the value of var1 is true, otherwise false (non-logical); Boolean logical operator: &; Category: Binary; example expression: var1 = var2 & var3; Result: if both var2 and var3 are true, the value of var1 is true; otherwise, the value is false (logical and); Boolean logical operator: |; Class: Binary; example expression: var1 = var2 | var3; Result: If var2 or var3 is true (or both), the value of var1 is true, otherwise false (logical or ); boolean logical operator: ^; Class: Binary; example expression: var1 = var2 ^ var3; Result: if one of var2 and var3 is true, the value of var1 is true, otherwise, the value is false (logical exclusive or). boolean operators & | are the same as boolean operators & | but the performance is better. boolean logical operator: &; Class: Binary; example expression: var1 = VaR 2 & var3; Result: if both var2 and var3 are true, the value of var1 is true; otherwise, the value is false (logical and); Boolean logical operator: ||; class: Binary; example expression: var1 = var2 | var3; Result: If var2 or var3 is rtue (or both), the value of var1 is true, otherwise false (logical or ); boolean value assignment operator: & =; Class: Binary; example expression: var1 & = var2; Result: The var1 value is the result of var2 & var3; Boolean value assignment operator: | =; class: Binary; example expression: var1 | = var2; Result: The var1 value is the result of var2 | var3; Boolean value assignment operator: ^ =; Category: Binary; example expression: var1 ^ = var2; Result: The var1 value is the result of var2 ^ var3. The result is the same as the &, | and ^ results, but the performance is better compared with the displacement OPERATOR:> =; Category: mona1; example Expression: var1 >>== var2; move the binary value of var1 to the right to obtain the value of var1. Displacement OPERATOR: <<==; Category: Mona; example expression: var1> = var2; move the binary value of var1 to the left to obtain the value of var1. The operator priority is ++, -- (used as the prefix); (), +, -(one dollar ),!, ~ *,/, % +,-<, >><, >,< =, >== ,! = &, |, ^, &, |, =, * =,/=, % =, + =,-+, <=, >>=, & =, ^ =, | = ++, -- (Used as a suffix)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.