- 1

Is it possible to set a string as a variable name?

So, if I have a string name = "test", can I assign that value to the name of a variable in the code, so test = 9 (for example)? Or if name = name + "1', then test1 = 9 (to show some practical uses).

20th Nov 2017, 11:52 AM
WdBros
WdBros - avatar
2 odpowiedzi
+ 1
I don't think you can but maybe this could help https://code.sololearn.com/cHXTF32759pY/?ref=app
20th Nov 2017, 12:29 PM
Nick
Nick - avatar
- 1
No, but you can use pointers to dynamicly assign memory.
20th Nov 2017, 1:44 PM
josh mizzi
josh mizzi - avatar