how can i solve binary system in c++? [closed]
how can i see the answer when i need to solve the decimal code to binary code?
decimal code
to binary code
? i think that you mean decimal number
to binary number
, so use std::bitset e.g.
#include <bitset>
...
int i = 49;
std::cout << std::bitset<sizeof(i)*8>(i).to_string() << std::endl;
精彩评论