Skip to content

Commit

Permalink
Update ex18_29.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
smzztx authored May 18, 2019
1 parent f25f5df commit 3652f6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ch18/ex18_29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Base *pb; Class *pc; MI *pmi; D2 *pd2;
Solution:
(a) Constructors run order: Class Base D1 D2 MI Class Final.
Destructors run order: Final Class MI D2 D1 Base Call.
Destructors run order: Final Class MI D2 D1 Base Class.
Class parts are constructed from left to right and base class to derived class.
(b) 1 Base part and 2 Class parts.
Because ‘Base’ is a virtual base class of ‘D1’ and ‘D2’. There is only 1 Base part.
Expand Down Expand Up @@ -81,4 +81,4 @@ int main(int argc, char const *argv[])
// pmi = pb;
pd2 = pmi;
return 0;
}
}

0 comments on commit 3652f6e

Please sign in to comment.