没什么问题吧?
a:00000011(3)
b:00000010(2),异或运算后
c:00000001(1)
显示1。很正常啊!(VC6.0结果)
^是位的异或运算 不是乘方
不知道你是真的要异或运算还是想算乘方但误以为^是乘方的意思
测试通过,
如果是提示:fatal error C1010: unexpected end of file while looking for precompiled header directive
可能是你忘了加头文件#include "stdafx.h"
看程序没问题 可能你要的是这种结果吧
#include
using namespace std;
int main()
{
int a=3,c;
c=a*a;
cout<
}
如果是编译错误,且用的是VC6.0或以下版本,可以试着把using namespace std;删了。