가상소멸자(2)
-
[C++] 가상함수를 써서 플레이어를 생성하는 함수를 호출해보자
#include #include using namespace std; struct Class { void virtual Attack() { cout
2022.06.13 -
[C++] 구조체/생성자와 소멸자/동적할당/동적배열/상속/가상함수
/* 학습목차 1. 구조체 2. 생성자와 소멸자 3. 동적할당 4. 동적배열 5. 상속 6. 가상함수 */ #include #include using namespace std; // 구조체 // 직접 만드는 쓰는 서로다른 데이터타입의 집합체 // 기능(멤버함수)과 속성(멤버변수)을 지닌 사용자 정의의 데이터타입 struct Monster { string name; int hp; int atk; void SetInfo(string _name, int _hp, int _atk) { name = _name; hp = _hp; atk = _atk; } void ShowInfo() { cout
2022.06.13