Creating variable -in runtime

Nov 30, 2012 at 3:55am
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 ?
Nov 30, 2012 at 4:00am
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.
Nov 30, 2012 at 4:03am
and what good would users creating variables do?
Nov 30, 2012 at 4:25am
i didnt ask what it was. i asked what good it will do
Nov 30, 2012 at 6:01am
Sure you can do it... it's called "writing your own programming language".

I'd start with google; good luck!
Nov 30, 2012 at 6:13am
closed account (z0XLy60M)
haha...no thnxx !

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