I'm having trouble converting a 16-bit std::string to an int that can hold the exact binary number of the string. I've been messing around with atoi and bitset but they converting to deciamls or take off leading zeros is there a way to do this
std::string str = "0011101100010101";
int num = 0;
.
.
.
num = 0011101100010101 // now equals