Hey guys, I'm reading data from a text file into a vector of strings and would like to pass these strings as parameters to a function. To be clear, I don't want to pass the actual strings as parameters, but the variable with the name which corresponds to the contents of each string.
I.e. I have a string containing the word "height" and a second string containing the word "age", I need to pass variables (of type int) called "height" and "age" to the same function for evaluation, depending on which one the user specifies in the data file. I'm not sure if this is possible, I've read something about using a map from strings to pointers but I'm not quite sure how to proceed. Any advice would be greatly appreciated.
Edited 7 Years Ago by darkpeakjim: n/a