5. 전역 함수 intnHitPoints= GetHitPoints(gameUnit);// Example DreamexeWarrock Client Team : 최준혁
6. 클래스 정적 함수 intnumUnits= GameUnit::GetNumUnits();// Example 비 가상 멤버 함수 GameUnitgameUnit; // 인스턴스 생성 IntnHitPoints= gameUnit.GetHitPoints(); // 멤버 함수 호출 DreamexeWarrock Client Team : 최준혁
7. 단일 상속에서의 가상 함수 GameUnit* pGameUnit= new SomeGameUnit; // 부모 클래스 인스턴스에 자식 클래스 할당 pGameUnit -> RunAI(); // 가상 함수 호출 GameUnit virtual void RunAI() { // virtual function } SomeGameUnit 상속 void RunAI() { // Override code} DreamexeWarrock Client Team : 최준혁
8. 다중상속에서의 가상 함수 C A A A B C B B Vtable Layout C DreamexeWarrock Client Team : 최준혁
9. 인라인화 If ( gameUnit.IsActive() ) { // … } Class GameUnit { inlineboolGameUnit::IsActive() const { return m_bActive; } }; If ( gameUnit.m_bActive ) { // … } DreamexeWarrock Client Team : 최준혁