int a,b;
a^b是什么意思?其中的^是什么运算操作符?没看到过。
a^b是什么意思?其中的^是什么运算操作符?没看到过。
解决方案 »
- 用WebBrowser2下载文件,怎么直接下载到指定目录而不弹出对话框 ?
- 自动提交Sitemap.xml
- 为什么module32first等函数根本没作用.不报错,就显示:press any key to continue;
- 关于创建文件的问题
- 问:如何编程监控CPU的占用情况?
- 我想把CTabCtrl的标签按钮放到右下方。哪位高手教我该怎么做?
- 请问如果下载软件遇到有跳转URL的地址,应该处理呢?
- 有什么方法可以让我的编译出来的动态库的体积小一点.现在已经216K了.而功能只实现了一半.
- installshield 问题
- 请问中国铁道出版社的Visual C++实践与提高系列怎么样?
- ActiveX 字体
- 有没有谁有2维网格的类定义
The bitwise exclusive OR operator (^) compares each bit of its first operand to the corresponding bit of its second operand. If one bit is 0 and the other bit is 1, the corresponding result bit is set to 1. Otherwise, the corresponding result bit is set to 0.Both operands to the bitwise exclusive OR operator must be of integral types. The usual arithmetic conversions covered in Arithmetic Conversions are applied to the operands.Operator Keyword for ^
The xor operator is the text // expre_Bitwise_Exclusive_OR_Operator.cpp
// compile with: /EHsc
// Demonstrate bitwise exclusive OR
#include <iostream>
using namespace std;
int main() {
unsigned short a = 0x5555; // pattern 0101 ...
unsigned short b = 0xFFFF; // pattern 1111 ... cout << hex << ( a ^ b ) << endl; // prints "aaaa" pattern 1010 ...
}
// compile with: /EHsc
// Demonstrate bitwise exclusive OR
#include <iostream>
using namespace std;
int main() {
unsigned short a = 0x5555; // pattern 0101 ...
unsigned short b = 0xFFFF; // pattern 1111 ... cout < < hex < < ( a ^ b ) < < endl; // prints "aaaa" pattern 1010 ...
}
如:
a += b; <=> a = a+b;
我想
a ^= b; <=> a = a^b;
a ^= b 相当于 a = a^b