int x = 5; cout<<(char)x;
the code above outputs an int x in raw binary, but only 1 byte. what I need it to do is output the x as 4-bytes in
A bit late, but, as Katy shows in her blog, this might be an elegant solution:
#include #include int main(){ int x=5; std::cout<(x)<
taken from: https://katyscode.wordpress.com/2012/05/12/printing-numbers-in-binary-format-in-c/