for example lets say your pulling data from somewhere and you put it in a string variable then you want to use the data inside of it to be the another strings name:
int main(void){
string strVar ="StringData"; //this is a string variable with text inside
cout<<strVar<<endl; //displaying the variables contents
string strVar.c_str() = "stuff in string variable 'StringData'"; //this uses what was inside of strVar to be the name of the new string variable
cout<<StringData<<endl; //prints the contents of the variable StringData (who got its name from the data inside of strVar
}
//OUTPUT:
StringData
stuff in string variable 'StringData'
i know you definitely cannot do it in this manner and in this example your would have to know before hand what was in strVar before you used the variable StringData, but can we theoretically do this?
Edit:
Thanks everyone, so what i get from you all is basically its not possible, C++ is not a Dynamic variable language and the closest thing i can get to it is with a map (string, string)
map<string, string>is what you want?