In C++, I need to do a binary to decimal conversion.
I know how to do it by hand, but I was wondering if there was a function that could do it for me.
For example, if I have a decimal number and want to print it in another base, I just call setbase (base).
std::cout<<std::setbase(16)<<20; // prints 20 in base 16. Is it possible to do something similar but convert from binary to decimal?