Object Oriented Programming Using C++ (313304) Practical No.21: Write programs to implement virtual function
The concept of virtual function helps to learn the idea of run time polymorphism in C++.
Exercise:
1. What is function overriding?
Answer:
2. Write output for the following code:
Answer:
Output:
C::fun() called
3. There are the following statements that are given below, which of them are correct about virtual functions in C++?
Answer:
2. A and B
Practical Related Questions
1. Define a class parent in which use read function, define another class child use same read function. Display the data of both the read function on output screen using virtual function.
Answer:
2. Write a program that shows the use of function overriding.
Answer:
3. Complete the following table:
We completed Object Oriented Programming Using C++ (313304) Practical No.21 and Write programs to implement virtual function.