#include <stdio.h>
class Base
{
public:
Base() { printf("base\n"); };
~Base() { printf("~base\n"); };
virtual void out() { printf("base out\n"); };
};
class A : public Base
{
public:
A() { printf("a\n"); };
~A() { printf("~a\n"); };
void out() { printf("a out\n"); };
};
class B : public Base
{
public:
B() { printf("b\n"); };
~B() { printf("b\n"); };
void out() { printf("b out\n"); }
};
void main()
{
A a;
Base* base = &a;
base->out();
base = new B;
base->out;
}
'직업에 관한 관심' 카테고리의 다른 글
| 브레즌햄 픽킹 알고리즘. (0) | 2007/06/12 |
|---|---|
| CEGUI-Create Render. (0) | 2007/06/05 |
| 가상함수와 다형성 그리고 생성자와 소멸자의 내부적인 호출에 관한 코드 (0) | 2007/05/22 |
| 맵툴 히스토리 (0) | 2007/05/16 |
| 3D 그래픽스 프로그래밍 스터디 모임 시작. (0) | 2007/05/13 |
| 기본 프레임워크 (0) | 2007/05/08 |
이올린에 북마크하기
이올린에 추천하기