Sunday, February 21, 2010

C++ Brain teasers !

-> What is IS-A relationship?
class Derived : public Base {};
class Derived : private Base {};
-> Are both of these inheritance IS-A ??
-> When is V-table formed
@Compile time ?? OR
@Run time ??
-> What is the rule of Function overloading??
like... how should two overloaded functions differ from each other.
-> Can we have a 2 overloaded funcitons which differ only in constnesss??
ex: void disco(char * sam) {}
void disco(char * sam) const {}
-Will these 2 functions be considered as overloaded or will it throw any error???
-> Can we have virtual functions as inline?
If NO then Y
If YES then HOW??
-> Whether we will achieve INLINING of these virtual functions
-> Can I redefine, a virtual function which is public in base class, in private of the derived class.
If NO then Y
If YES then HOW??
-> Will that private redefined function of derived class be accessible through base class pointer ??
-> Can we have a pure virtual destructor??

........LOADING

No comments:

Post a Comment