How to use another classes member variables in c++?
- by Stephen
Hi there
I'm currently programming a Yahtzee game, and I'm having trouble with some of my classes
I have two classes, Player, and Scorecard.
class Player {
private:
string name;
Scorecard scorecard;
};
class Scorecard {
public:
void display() {
//...
}
};
(All the classes have the appropriate getters and setters)
I'd like the scorecard class to be able to display the name of the player to the user. Is there any way that can be done?