arbitrary number of variables without using arrays

is there a way were i can create a variable with a variable name and then how would i acess said variable.
You can use std::map http://www.cplusplus.com/reference/stl/map/

like so:
1
2
3
std::map<std::string, int> foo;
foo["bar"] = 100;
int val = foo["bar"];
Topic archived. No new replies allowed.