결국 뭐 좀 해볼려고 하면, 결국에는 포인터로 귀결이 되는구나.

 

/*
    CPointer2.cpp
*/

#include <iostream>
#include <string.h>

using std::cout;
using std::endl;

class Person
{
public :
    void Sleep()
    {
        cout<<"Sleep"<<endl;
    }
};

class Student : public Peson
{
public :
    void Study()
    {
        cout<<"Study"<<endl;
    }
};

class PartTimeStd : public Student
{
public :
    void Work()
    {
        cout<<"Work"<<endl;
    }
};

int main(void)
{
    Person* p3 = new PartTimeStd;

    p3->Sleep();

    return 0;
}

반응형

'C, C++, Java' 카테고리의 다른 글

CReference2.cpp  (0) 2014.05.02
P304.cpp  (0) 2014.05.02
EmployeeManager3.cpp  (0) 2014.05.02
Person.cpp  (0) 2014.04.30
P256.cpp  (0) 2014.04.30

+ Recent posts