![]() |
| Home | Tech FAQ | Interview Questions | Placement Papers | Tech Articles | Learn | Freelance Projects | Online Testing | Geeks Talk | Job Postings | Knowledge Base | Site Search | Add/Ask Question |
![]() Related Questions Latest Answer : When classes are inherited, we need to make the base class destructor virtual – to make sure when the object is destroyed, all the derived class destructors also called. Otherwise the derived class destructors are not called because the there is compile ... Latest Answer : Hi In My opinion there is no such concept In C++ But some says Can anyone tell mehow is it possible??? ... Latest Answer : In C you would use an array of pointer-to-functions and call the functions by using the array index. ... Latest Answer : Also increases memory consumption since a virtual function address table has to be maintained in RAM ... Latest Answer : Virtual Base Class: Used in context of multiple inheritance in C++. If you plan to derive two classes from a class, and further derive one class from the two classes in the second level, you need to declare the uppermost base class as 'virtual' in the ... Latest Answer : To achieve runtime polymorphism.For a virtual function which is defined in both the base and derived classes, the decision of which implementation to call is taken at runtime depending on the type of object, and NOT depending on the declaration type of ... Latest Answer : A pure virtual function is a function declaration with the keyword 'virtual' prefixed to it and definition equated to 0. In C++ declaring a pure virtual function makes the class abstract.e.g. virtual void f() = 0; ... Latest Answer : Virtual base class is a term used in C++ multiple inheritance.Assume the following -- base class P. Two classes A and B derive from P. A third class C derives from both A and B.P has a protected variable pvar. A class C method accesses this variable. ... Latest Answer : Virtual destructor has the same concept as a virtual function.To decide at runtime, depending on the type of object, whether to call derived class destructor or base class destructor. Useful in situations where base class pointer is used to create a derived ... Latest Answer : At the time of constructing the object the type is given as input (B *ptr = new D) here it is clearly known that D's constructor is to be called. However while destroying, delete ptr; does not make it clear whether to call B's destructor (looking at the ...
Sponsored Links
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||