19 weeks in C ++ bitwise exclusive OR ^, &, |

^ c++:

In C ++ bitwise exclusive OR ^, &, |

https://www.cnblogs.com/gkh-whu/p/11478300.html

Exclusive OR, the corresponding bits, if different, 1 is returned, the same returns 0

^ Is a special character, it indicates caret; in ANSI C, the introduction of ternary character, for the input method is not certain character on the keyboard. In this case the character may represent a dislocation ^ ternary symbol "?? /."

^ It may also represent a particular binary operator - bitwise logical operators (for bit data operation), meaning it represents the bit-wise or non requires two integer operand. Starting from the smallest (i.e. rightmost) bit, by bit operations on operands; if only one bit is 1, the result is 1; and 0 otherwise.

1, represents a direct address of a. For example: The statement "sbit led1 = P1 ^ 0;"; statement means: the first port P1 bit 0 (least significant bit) that is P1.0 renamed led1, the lowest level after the P1 port to operate separately, they It can be directly operated led1.

2 shows a power operation of the immediate data. For example: y = e ^ x, y represents the power of e is equal to x. (The same applies in mathematics applications)

3, on the back by the symbol ^ type name to specify the type of handle. For example, the following statement to declare an object of type String can store addresses, track named proverb statement: String ^ proverb.

4, the statement variable is defined proverb String ^ type of tracking handle. When a statement handle, the system automatically initialized to a null value, so the handle will not reference any object. Nullptr keyword can be explicitly set to a null value: proverb = nullptr.

Guess you like

Origin www.cnblogs.com/xiuxianren/p/12155947.html