![]() |
#2
zcdjt2014-09-21 22:55
|
编译结果为7 和 9, 请高手解释 不太理解
#include<iostream>
#include<bitset>
using namespace std;
void main()
{
bitset<4> bit(1111);
cout<<bit.to_ulong()<<endl;
bitset<4> ait(1001);
cout<<ait.to_ulong()<<endl;
}
那对于以下的代码呢 编译结果为9 如何解释呢
#include<iostream>
#include<bitset>
using namespace std;
void main()
{
bitset<5> a(00111);
cout<<a.to_ulong();
}