can i convert a string to an arithmetic expression?
Yes. You can do almost anything in C++ :)
or i must do it on hard way?
Some languages have functionality such as Python's "eval", which can convert strings into Python expressions at execution. This does not exist in a compiled language like C++, although it's possible something like Reflection may be implemented in the future.
Short answer is "yes", you must do it the "hard" way.
I suggest looking into the Shunting-yard algorithm, which can transform a "human-readable" mathematical expression string into a Reverse-Polish notation string, or an expression tree. https://en.wikipedia.org/wiki/Shunting-yard_algorithm
Also note that various libraries exist to do mathematical equations using strings or build expression trees, but I have not used any enough to suggest a particular one.
What you are doing, if you did not understand it...
the alphabet (ascii) table is just numbers, and it is ordered 0123456789 but those are not the integer values, its like (I forget) 40,41,42 or something like that. So you subtract the table value (eg 45 as '5' ) minus the table value of zero (40) giving 5 (the right answer). 40 is just a made up example, I didnt look up the real value.
if you need to do this for anything other than a character, eg "1234" you need stoi() type functions (String TO Int)
i see 2 problems(for now):
1 - sometimes the operators isn't converted correctly from char to string :( ;
2 - why the last math isn't done? (if i do "4+3", it's done)