Let's say that I have a string variable called "numbers" that is defined as "12345" in string:
string numbers = "12345";
If that is the case, how do I convert that variable so that I can store those as integers instead? Now I know that there are multiple ways to do it using the string library like stoi, atoi, stringstream, and etc... but the trick here is to make it possible WITHOUT using any of those. I personally do not understand this assignment when there are MUCH efficient ways to do it but that's just my opinion.
I was thinking if I would make a function where it stores individual numbers as array of chars using loops and somehow stick those together as an int. Am I going into the right track?
Thank you
EDIT: I am talking about c++