Creating variable -in runtime

closed account (z0XLy60M)
Okay, so is it possible to take an input (a string) from the user ,have him select a datatype ..

and then create a variable of that datatype of that name(the string) ...?

nee idea ppl ?
No, as C++ is not reflective. Thinking about that, though, I might ask: how does that make sense? How would you refer to such a variable? What if the user's supplied name clashes with a variable you are have declared?

You could sort of emulate it with a mapping of strings to arbitrary data types, however.
and what good would users creating variables do?
i didnt ask what it was. i asked what good it will do
Sure you can do it... it's called "writing your own programming language".

I'd start with google; good luck!
closed account (z0XLy60M)
haha...no thnxx !

I prefer to keep my sanity first :)
Topic archived. No new replies allowed.