Convert from decimal to binary in C++

Rothbard
Rothbard used Ask the Experts™
on
Is there some functionality already available in C++14 to convert a number from decimal representation into binary?

Thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
I found the solution on StackOverflow:

std::string binary = std::bitset<8>(n).to_string();

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial