#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...
-
프루나는 이제 믿을만한 공유가 안되고 있다. 젠장. 영화 다운 받아보면 전부 야동이나 포르노류 밖에는 없다. 신고되어 있는 자료부터 보지만 신고가 안되어 있는 것은 제대로 다운도 되지 않는다. 이젠 유료 사이트를 믿을 수 밖엔... ...
-
간만에 아침에 운동 갔다가 일하고 나서 피곤한 몸을 이끌고 쓰고 있다. 새벽 4시 50분에 일어났는데 나도 모르게 운동을 하러 나가게 되었다. 막 전역 했을 때 28인치던 내 허리가 지금은 36에 육박한다. 우스운 것이 배만 ...
-
SELinux 불린 값을 이용해서 SELinux.getBooleanValue("xxxx") SELinux.setBooleanValue("xxxx", yyyy); Policy 에도 if 문을 줄...
댓글 없음:
댓글 쓰기
국정원의 댓글 공작을 지탄합니다.