vc++中画线时xor_C ++'xor_eq'关键字和示例
vc++中畫線時xor
"xor_eq" is an inbuilt keyword that has been around since at least C++98. It is an alternative to ^= (EXCLUSIVE-OR Assignment) operator and it mostly uses for bit manipulations.
“ xor_eq”是一個內置關鍵字,至少從C ++ 98起就存在。 它是^ = ( EXCLUSIVE-OR Assignment )運算符的替代方法,它主要用于位操作。
The xor_eq keyword performs EXCLUSIVE-OR operation and assigns the result to the left/first operand.
xor_eq關鍵字執行EXCLUSIVE-OR運算,并將結果分配給左/第一個操作數。
Syntax:
句法:
operand_1 xor_eq operand_2;Here, operand_1 and operand_2 are the operands.
在這里,操作數_1和操作數_2是操作數。
Example:
例:
Input:bitset<4> value("1100");bitset<4> mask ("1010");value xor_eq mask;Output:value = 0110演示使用“ xor_eq”關鍵字的C ++示例 (C++ example to demonstrate the use of "xor_eq" keyword)
// C++ example to demonstrate the use of //'xor_eq' keyword#include <iostream> #include <bitset> using namespace std;int main() {//bitsetsbitset<4> value("1011");bitset<4> mask1("1100");bitset<4> mask2("0100");// before operationcout << "value: " << value << endl;cout << "mask1: " << mask1 << endl;cout << "mask2: " << mask2 << endl;value xor_eq mask1;cout << "After operation (1)...\n";cout << "value: " << value << endl;value xor_eq mask2;cout << "After operation (2)...\n";cout << "value: " << value << endl;return 0; }Output:
輸出:
value: 1011 mask1: 1100 mask2: 0100 After operation (1)... value: 0111 After operation (2)... value: 001翻譯自: https://www.includehelp.com/cpp-tutorial/xor_eq-keyword-with-example.aspx
vc++中畫線時xor
總結
以上是生活随笔為你收集整理的vc++中画线时xor_C ++'xor_eq'关键字和示例的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ajax应用_AJAX的应用
- 下一篇: win7变成xp风格了怎么改回_XP退役