Quantcast
Channel: Comments on: 11.4 — Constructors and initialization of derived classes
Viewing all articles
Browse latest Browse all 159

By: shraa

$
0
0

Thanks Alex but it wont work by removing empty parenthesis as then there will be ambiguous call to
overloaded Derived (constructor)..In all way its giving me error..

Can’t I declare below two constructors in Derived class:
Derived(double db=0):d(db){} //one where i don’t call Base class’s constructor
Derived(double db=0,int i=0):d(db),Base(i){} //another where i call Base class’s constructor.


Viewing all articles
Browse latest Browse all 159

Trending Articles