#include <iostream.h>
class A {
int no;
protected:
char ch;
public:
A() {} //인수를 전달받지 않는 생성자는 꼭 만들어 줘야함.
A(int n);
~A();
void output(void);
void sub(void);
};
A::A(int n)
{
no = n;
}
A::~A()
{
cout << "A Distructor\n";
}
void A::sub(void)
{
cout << "---------class";
}
void A::output(void)
{
cout << no << endl;
}
class B:public A {
int sum;
public:
A::ch;
//A::no; //is not accessible
B() {}
B(int n, char c, int s);
~B();
void sub(void);
};
B::B(int n, char c, int s):A(n)
{
ch = c;
sum = s;
}
B::~B()
{
cout << "B extructor \n";
}
void B::sub(void)
{
cout << ch << '\t'
<< sum << '\t';
output();
}
void main(void)
{
B bb(5, 'A', 10);
cout << sizeof(bb) <<endl;
bb.sub();
}
클레스 정의 밑 호출 방법.
1~50까지의 소스는 유영각 강사님의 머릿속에 들어있던 내용이었다.
화이트 보드와 펜 하나로 강의하면서 수강생들은 모두 실습할 수 있는 인상적인 강의였다.
손으로 코딩을 하실 줄이야...
피드 구독하기:
댓글 (Atom)
UPBIT is a South Korean company, and people died of suicide cause of coin investment.
UPBIT is a South Korean company, and people died of suicide cause of coin. The company helps the people who control the market price manipu...
-
프루나는 이제 믿을만한 공유가 안되고 있다. 젠장. 영화 다운 받아보면 전부 야동이나 포르노류 밖에는 없다. 신고되어 있는 자료부터 보지만 신고가 안되어 있는 것은 제대로 다운도 되지 않는다. 이젠 유료 사이트를 믿을 수 밖엔... ...
-
Intel의 새로운 MMX - "KNI" KNI 는 Katmai New Instruction 의 약자이다 . 아는 분들은 잘 알고있겠지만 KATMAI( 이하 카트마이로 부름 ) 는 인텔의 다음번 펜티엄...
-
C:\program files\ 베이비론 폴더가 있다. 브라우저 창 다닫고 지우고 다시 실행하면 없어진다.
댓글 없음:
댓글 쓰기
국정원의 댓글 공작을 지탄합니다.