코드

#include "pch.h"
#include <iostream>

class Status
{
public:
	void Move()
	{
		printf("Status\n");
	}
};

class Monster
{
public:
	void Move()
	{
		printf("Monster\n");
	}
};

class Slime : public Monster, public Status
{
public:
	void Move()
	{
		printf("Slime\n");
	}
	void move()
	{
		printf("slime\n");
	}
};

int main()
{
	Slime a;
	a.Move();
	a.move();
	a.Monster::Move();
	a.Status::Move();
}

결과

 

+ Recent posts