what is the virtual function overhead, and what is it used
for ? i hope i can get and appropriate answers, thanks a lot....
Answer Posted / sanish joseph
I thnk virtual fns r declared with 'virtual' keyword
nd it must be redifend in the derivd classes.
wen mor dan one classes derivs a methd in the base class,
dat method can be writn with virtual to avoid ambiguity.
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
What are the types of abstraction?
What is the fundamental idea of oop?
What are the benefits of oop?
What polymorphism means?
What are two types of polymorphism?
What is overriding in oop?
write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.
Why interface is used?
What is difference between polymorphism and inheritance?
How to call a non virtual function in the derived class by using base class pointer
What is the use of oops?
What does and I oop mean in text?
What is abstract class in oop?
How is class defined?