Hello :) I'm trying to do a conversion of a string to an int using c++. I have tried using stol, stoll, and strtol functions and (maybe I was using them wrong) but they didn't seem to preserve my string in a literal sense.
Question: How would I go about literally converting a string containing 0s and 1s to an int so that my int is exactly like my string was.
Example:
string s = "00010011";
int digits = 0; // convert int to: digits = 00010011;
Appreciate it!