0xffffffff is only 32 bit, so can someone tell me why would b be 64 1s? Shouldn't it be printing out 32 0s follow by 32 1s?
#include <iostream>
#include <bitset>
using namespace std;
int main()
{
int a = 0xffffffff;
string b = bitset<64>(a).to_string();
cout << b;
return 0;
}
User contributions licensed under CC BY-SA 3.0