2016. 4. 14. 10:46
밑의 코드처럼 선언하시면 됩니다.
상속받아 사용할 때는 소멸자를 꼭 포함 시켜야 한다는점을 잊지마세요~

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "stdafx.h"
#include <iostream>
 
class _IRef{
public:
    virtual ~_IRef(){}
    virtual void _Update() = 0;
};
 
class Node : public _IRef{
public:
    ~Node(){}
    void _Update(){ std::cout << "Node Update" << std::endl; }
};
 
class user{
public:
    void Something(_IRef* Ir){ Ir->_Update(); }
};
 
int _tmain(int argc, _TCHAR* argv[])
{
    Node* c = new Node;
    user u;
    u.Something(c);
 
    return 0;
}
 
 
 
cs



Posted by 시리시안