Possible duplicate:Convert string to variable name or variable type
How to use string value as variable name in C ++
string listName = "hari"; string vectorName = "BF_vector_"+listName; vector<string> vectorName; vectorName.push_back("Some Value");
How to use the string value ("BF_vector_hari") vectorName as the name of a vector variable.? Thanks in advance.
You cannot in C ++.
One thing you can do is use the form std::map<std::string, std::vector>to store the name on a vector map.
std::map<std::string, std::vector>
No.
- . ( , ). ( - ), .
.