vc6.0的相关问题
vc6.0不能赋值这样
int number = 0b1100; //(二进制)
但可以这样
int number = 0xc; //(十六进制)
这是为什么?
[此贴子已经被作者于2015-11-29 10:47编辑过]
#include <iostream> #include <cstdlib> #include <bitset> #include <conio.h> int main(void) { std::bitset<4> x("1100"); std::cout << "0b" << x << " is " << x.to_ulong() << std::endl; const unsigned int y = 15; std::cout << y << " is " << std::bitset<8>(y) << std::endl; _getch(); return EXIT_SUCCESS; }