vendredi 24 avril 2015

Printing std::bitset in C++11

Consider the following code written in C++11:

#include <iostream>
#include <bitset>
#include <cstdint>

int main() {

    std::uint64_t a = 0000000000000000000000000000000000000000000000001111111100000000;
    std::bitset<64> b(a);

    std::cout << b << std::endl;

    return 0;
}

The output of the code is :

0000000000000000001001001001001001001001000000000000000000000000

Why this output does not correspond to the a value?

Aucun commentaire:

Enregistrer un commentaire