Hey, I'm currently learning about classes and I am wondering how to implement a sub-class into a class.
I have a class atm called "Person" but I want to create a sub-class called administrators. So would it be:
Class person
{
public:
// class methods
// class methods
private:
// object classifications
// object classifications
class Admin
{
public:
// class methods
// class methods
private:
// object classifications
// object classifications
};
};
Or would it be:
Class Person
{
public:
// class methods
// class methods
private:
// object classifications
// object classifications
};
class Admin
{
public: Person
private:
// object classifications
// object classifications
};
The other thing, how would I implement it? For example I have currently:
int main()
{
Person p1;
p1.setName("ddgdjgdgjdg");
}
But how would I set p1 to use the admin class?
Thanks for any help