You can use the std::bitset<> class. See sample below.
#include <bitset>
#include <iostream>
using namespace std;
int main()
{
bitset<64> allBits("010010000110010101101100011011000110111100100001");
cout << allBits.to_ullong(); // C++ 11. If using earlier version, use to_ulong().
}
Note that the integer will need to fit within the maximum limit of an unsigned long if to_ulong() is used, and an unsigned long long if to_ullong() is used.