georgemih,
I mean being able to perform a kind of macro substitution so the contents of pszVar is seeing at Run time as the statement int iVar = 10;
OK, you say it’s not possible to compile code at run-time perhaps, but it was accomplish before and I just would like to know the mechanisms or if there is any function available you guys know that make C++ transform a string containing a statement in a valid C++ line of code.
Other than that, this new question, I believe, was legit.
Although the other question I posted before “How to convert an arithmetic string expression to an int result” is related to this one, my goal at that time was to find a solution to convert a mathematical string operation using a most simple manner, in opposite of this new question that seeks to explorer a way to execute code generated dynamically, which would open innumerous possibilities to simplify our lives as programmers as I have seen before.
Pete, I appreciated your help by taking your time and answering my questions, but I want to believe that like me, most programmers don’t give up easily when seeing only a couple of answers that were indeed correct as you mentioned (I never said it wasn’t) but not necessary providing solutions. So, I searched for other ways and found a solution for the “arithmetic string expression” problem and I was happy to go back to my thread, post the solution and share it with you all.
However, that was a huge effort for the programmer who made the solution and I wanted to insist that there is perhaps a better way to do things and share with the forum.
Thanks for the comments!
Regards,
Cosmo