What is the difference between pure virtual function and virtual function?



What is the difference between pure virtual function and virtual function?..

Answer / Ashish Ghildiyal

"In C++, both pure virtual functions and virtual functions are part of polymorphism. However, there's a key difference:n- A virtual function is a member function in a base class that can be overridden by derived classes.n- A pure virtual function is a virtual function that has no implementation in the base class and must be overridden by derived classes to be used. A class containing at least one pure virtual function is an abstract class, meaning it cannot be instantiated.".

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

Write a program to display the no of bit difference between any 2 given numbers eg: Num1 will 12->1100 Num2 will 7->0111 the difference in bits are 2.

4 Answers  


#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; s1=s2; printf("%s",s1); } Find the output

5 Answers   CitiGroup,


which of the following statements is incorrect a.typedef struct new{ int n1; char n2; } DATA; b.typedef struct { int n3; char *n4; }ICE; c.typedef union { int n5; float n6; } UDT; d.#typedef union { int n7; float n8; } TUDAT;

5 Answers   Assurgent, TCS,


Can the sizeof operator be used to tell the size of an array passed to a function?

1 Answers  


What is the difference between char array and char pointer?

1 Answers  


C,c++, Java is all are structural oriented or procedure oriented language..?

6 Answers  


is it possible to create your own header files?

1 Answers  


What is the purpose of main( ) in c language?

1 Answers  


Is null a keyword in c?

1 Answers  


sir i got 146 correct question & i have also the advantage of height so will they consider my marks as 146+3=149.can any body tell me how they consider my height marks.

1 Answers  


What standard functions are available to manipulate strings?

1 Answers  


Write a c program using for loop in switch case?

1 Answers   Infosys,


Categories