1string bin_string = "10101010";
2int number =0;
3number = stoi(bin_string, 0, 2);
4// number = 170
1// if the error terminate called after throwing an instance of
2// 'std::out_of_range' what(): stoi
3// is being thrown by stoi use stol
4string bin_string = "0101010101010101010101010101010101010101010101010101";
5long number = 0;
6number = stol(bin_string,0,2); // number = 1501199875790165