日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

__eq___C ++'and_eq'关键字和示例

發布時間:2023/12/1 编程问答 18 豆豆
生活随笔 收集整理的這篇文章主要介紹了 __eq___C ++'and_eq'关键字和示例 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

__eq__

"and_eq" is an inbuilt keyword that has been around since at least C++98. It is an alternative to &= (Bitwise AND Assignment) operator and it mostly uses for bit manipulations.

“ and_eq”是一個內置關鍵字,至少從C ++ 98起就存在。 它是&= ( 按位與賦值 )運算符的替代方法,它主要用于位操作。

The and_eq keyword performs Bitwise AND operation and assigns the result to the left/first operand.

and_eq關鍵字執行按位與運算,并將結果分配給左/第一個操作數。

Syntax:

句法:

operand_1 and_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 and_eq mask;Output:value = 1000

演示使用“ and_eq”關鍵字的C ++示例 (C++ example to demonstrate the use of "and_eq" keyword)

// C++ example to demonstrate the use of // 'and_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 and_eq mask1;cout << "After operation (1)...\n";cout << "value: " << value << endl;value and_eq mask2;cout << "After operation (2)...\n";cout << "value: " << value << endl;return 0; }

Output:

輸出:

value: 1011 mask1: 1100 mask2: 0100 After operation (1)... value: 1000 After operation (2)... value: 0000

翻譯自: https://www.includehelp.com/cpp-tutorial/and_eq-keyword-with-example.aspx

__eq__

總結

以上是生活随笔為你收集整理的__eq___C ++'and_eq'关键字和示例的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。