You can't do that directly in C++. A more normal approach is to have an enumeration that indicates which variable to use, and set that. Then you have an array/vector of values, and the enumerator acts as an index into that container.
You could also create a map that maps the strings to a particular value, but that may add additional overhead.