|
5/30 |
2003/3/7-8 [Uncategorized] UID:27618 Activity:nil |
3/7 C++ Question: what is the purpose of the following? Derived::Derived() : Base("foo", "bar") { // constructor stuff here... } Base is the superclass of Derived. I know the stuff following the single colon is the initialization list, but why is it calling the parent class's constructor? Isn't that done automatically? TIA. \_ if parent class is listed in the initialization list, it calls the constructor that has those parameters. Otherwise the default constructor (w/ no parameters) is called |