I am trying to find a way to call an object's members, but using a user input to determine which object. So, I have 3 objects: obj1, obj2, obj3. I then ask a user to enter which object they want to manipulate. Then using this input, I call the respective object's member function.
string input;
cin >> input;
input.memberfunc();//where input is obj1, for example
I understand that this is obviously not the way, and that I would firstly have to convert the string etc., but would appreciate any advise on the best way to achieve my requirement.