1class CA
 2{
 3public:
 4    CA(int b);
 5private:
 6    int m_a;
 7    int m_b;
 8}
;
 9CA::CA(int b) : m_a(1),m_b(b)
10{}
11
12class CB : public CA
13{
14public:
15    CB(int c);
16private:
17    int m_c;
18}
;
19CB::CB(int c) : CA(c-1), m_c(c)
20{}
21
22void main()
23{
24    CB cb(3);
25}

26/*
27cb.m_a = 1;
28cb.m_b = 2;
29cb.m_c = 3;
30*/
posted on 2007-08-08 10:10  陈峰  阅读(649)  评论(0)    收藏  举报