#include <iostream>
#include <string>
#include <bitset>
int main()
{
std::string s("100"); // 100 in binary is 4 in decimal
// Note: You have to specify exactly how many bits you need
std::bitset<sizeof(int) * 8> b(s);
std::cout << b.to_ulong() << '
';
return 0;
}