C++언어 특징

C++언어 특징

January 12, 2020 ( last updated : January 11, 2020 )
c++

https://github.com/gmm117/gmm117.github.io


Abstract

    C++ 특징

가상함수

가상함수 하는 이유

가상함수 예제

Third *tptr = new Third();
Second *sptr = tptr; 
First * fptr = sptr;

tptr->FirstFunc()   (o)
tptr->SecondFunc()  (o)
tptr->ThirdFunc()   (o)

sptr->FirstFunc()   (o)
sptr->SecondFunc()  (o)
sptr->ThirdFunc()   (o)

fptr->FirstFunc()   (o)
fptr->SecondFunc()  (o)
fptr->ThirdFunc()   (o)

순수가상함수

virtual int GetPay() const = 0;

추상클래스

1) 객체 생성이 불가능한 클래스 2) 하나 이상의 순수 가상 함수 포함

가상소멸자

vitual ~First();

Originally published January 12, 2020
Latest update January 11, 2020

Related posts :