추상 클래스1 C++ 상속inheritance, (순수)가상함수(pure)virtual function, 추상 클래스(abstract class), overriding, 바인딩 가상 함수 정의 virtual 기본 클래스 멤버 함수의 선언;virtual int computeSalary() { return 1500000; } 가상 함수 구현 Code 예시 #include #include using namespace std; //추상 클래스class Employee{private:string name;int id; public:Employee();Employee(string name, int id);~Employee();void setName(string name);string getName();void setId(int id);int getId(); virtual int computeSalary() { return 1500000; } //가상 함수, 보다 직관적으로 함수를 호출};.. 2019. 1. 18. 이전 1 다음