Hello, this is my first post in this forum.
I'm having trouble using string in class.In this program user inputs his player's name and race.In the output I want to show what he typed in 2 different lines.But the constructor does not seem to work.You can run the code uncommenting line 18.The string 'name' is not copying the string input by the user.
What am I doing wrong?
In your constructor you are not assigning values to your private member variables, but you are changingthe copies of input parameters.
name = n;
race = r;