Why do we need virtual function? Explain with example, how you implement run time polymorphism.
Polymorphism and Dynamic Binding
CT 501 · Chapter 7
Your campus trial expires in
Click to unlock Premium0%
— out of — readSign in to save progress
Course Resources
- Chapters
- 10
- Questions
- 17
Past questions by syllabus
Polymorphism and Dynamic Binding
Need of Virtual Functions
2 questions- 2080 BaishakhChapter 7: Polymorphism and Dynamic Binding7.1 Need of Virtual Functions
- 2070 ChaitraChapter 7: Polymorphism and Dynamic Binding7.1 Need of Virtual Functions
Why do we need virtual function? Explain with suitable example. What is pure virtual function? What is the task of reinterpret cast operator?
Pure Virtual Functions and Abstract Classes
6 questions- 2082 Shrawan2081 BaishakhChapter 7: Polymorphism and Dynamic Binding7.5 Pure Virtual Functions and Abstract Classes
What are the different types of polymorphism? Explain pure virtual function. Create an abstract class polygon with length and height as its data members. Make area() a pure virtual function and redefine it in derived classes triangle and rectangle to calculate respective area. Your program should demonstrate run time polymorphism.
- 2083 BaishakhChapter 7: Polymorphism and Dynamic Binding7.5 Pure Virtual Functions and Abstract ClassesClick to unlock premiumSee the full question with a premium plan
- 2081 BhadraChapter 7: Polymorphism and Dynamic Binding7.5 Pure Virtual Functions and Abstract ClassesClick to unlock premiumSee the full question with a premium plan
- 2075 AshwinChapter 7: Polymorphism and Dynamic Binding7.5 Pure Virtual Functions and Abstract ClassesClick to unlock premiumSee the full question with a premium plan
- 2074 ChaitraChapter 7: Polymorphism and Dynamic Binding7.5 Pure Virtual Functions and Abstract ClassesClick to unlock premiumSee the full question with a premium plan
- 2070 AshadhChapter 7: Polymorphism and Dynamic Binding7.5 Pure Virtual Functions and Abstract ClassesClick to unlock premiumSee the full question with a premium plan
Virtual Destructors
1 question- 2072 ChaitraChapter 7: Polymorphism and Dynamic Binding7.6 Virtual DestructorsClick to unlock premiumSee the full question with a premium plan
Run-Time Type Information
8 questions- 2078 Bhadra2076 Chaitra2069 ChaitraChapter 7: Polymorphism and Dynamic Binding7.8 Run-Time Type InformationClick to unlock premiumSee the full question with a premium plan
- 2079 Bhadra2076 AshwinChapter 7: Polymorphism and Dynamic Binding7.8 Run-Time Type InformationClick to unlock premiumSee the full question with a premium plan
- 2082 BaishakhChapter 7: Polymorphism and Dynamic Binding7.8 Run-Time Type InformationClick to unlock premiumSee the full question with a premium plan
- 2080 BhadraChapter 7: Polymorphism and Dynamic Binding7.8 Run-Time Type InformationClick to unlock premiumSee the full question with a premium plan
- 2078 KartikChapter 7: Polymorphism and Dynamic Binding7.8 Run-Time Type InformationClick to unlock premiumSee the full question with a premium plan
- 2074 AshwinChapter 7: Polymorphism and Dynamic Binding7.8 Run-Time Type InformationClick to unlock premiumSee the full question with a premium plan
- 2072 KartikChapter 7: Polymorphism and Dynamic Binding7.8 Run-Time Type InformationClick to unlock premiumSee the full question with a premium plan
- 2068 BaishakhChapter 7: Polymorphism and Dynamic Binding7.8 Run-Time Type InformationClick to unlock premiumSee the full question with a premium plan