Qualcomm Interview Question
Software Engineer / DevelopersA Function said to be pure virtual function if in base class member function is declared with = 0 ; operator,and it expects the derived class to implement that functionality.
For instance ,, public class A
{
// pure virtual fu
virtual int getNumberOfAppication() = 0;
}
public class B: public A
{
int getNumberOfAppication();
// write your own code
}
please correct me I'm wrong,,
pure virtual function is the function that provides only prototype and not the implementation. This forces derived class to override this function and provide implementation.
e.g. mathclass can have pure vitual function --> mathoperation()
but no implementation for it.
and its derived classes add and subtract can override this mathoperation() function
and can provide implementations.
No you are correct
- Shady July 17, 2011