So, I ran into this problem while trying to create a text based game to play at work. :P
I wanted users to be able to make their new character, and the character object would be named, whatever they input. I know that I can just have a string variable that holds the name and use a counter, but even then, can I make the program change that? Here's an example.
(in this situation there is a menu that uses switch case, and another file with the class 'Character')
case: 1
string tempName;
cout << "Please enter the name of your new character." << endl;
cin >> tempName;
Character tempName();
Character.setName(tempName);
cout << "Congratulations! Your character " << Character.getName() << " has been created." << endl;