Universal variable type?

Is there any variable that will accept a user-input equation of "6 * (5 + 2) / 4" as an example?
If I have correctly understood you can use either standard class std::string or a character array.
const char * foo = "6 * (5 + 2) / 4" or
1
2
#include <string>
std::string foo = "6 * (5 + 2) / 4"
Last edited on
closed account (4z0M4iN6)
If you would like, that a variable should accept each data type, also code, maybe, that you would like can be executed (and also compiled before), then you should take a dynamic programming language, which you can also combine with C/C++.

I would take "squirrel", because it has a C/C++ like syntax.

Some informations about squirrel and download here:

http://www.squirrel-lang.org/

If you would be interersted, I also could offer a C/C++ squirrel interface
Topic archived. No new replies allowed.