B
B
Bogdan Zhuvak2020-07-30 03:30:02
C++ / C#
Bogdan Zhuvak, 2020-07-30 03:30:02

How to remove leading zeros when outputting a binary number via std::bitset?

long long x = 893;
std::cout << std::bitset<32> (x);

Output 00000000000000000000001101111101
How to remove these zeros at the beginning so that the output is 1101111101.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question