What is a pure virtual function?
Why is it represented as = 0...how is the internal
implementation for the same
Answers were Sorted based on User's Feedback
Answer / vikas
A pure virtual function makes a class abstract.0 is used in
its representation to distinguish it from a normal virtual
function. More at
http://www.cppquestions.com/viewtopic.php?f=26&t=14
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / helloworld
I believe pure virtual function is a member function with a
declaration as NULL;
virtual void fun()=0;
Now why zero,since the internal implementation of virtual
function is collection of function pointer ...we intialize
this value of function pointers as NULL.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / viji
A virtual function with a null body is said to be pure
virtual function.
The pure virtual function can be defined later in its
derived class.......
Is This Answer Correct ? | 3 Yes | 2 No |
I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.
Why c++ does not have finally?
Name four predefined macros.
what is importance of data sturture in a programming language?
22 Answers L&T, TCS, Wipro,
Differentiate between declaration and definition.
Distinguish between new and malloc and delete and free().
What is the size of integer variable?
Can we run c program in turbo c++?
Explain how would you handle a situation where you cannot call the destructor of a local explicitly?
Explain polymorphism?
What is the correct syntax for inheritance a) class aclass : public superclass b) class aclass inherit superclass c) class aclass <-superclass
Please post the model question paper of hal?