Q. Which of the following is the correct way to define a pure virtual function in C++?

  • (A) virtual void myFunction() = 0;
  • (B) void virtual myFunction() = 0;
  • (C) Both A and B
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) virtual void myFunction() = 0;
Explanation: The correct way to define a pure virtual function is 'virtual void myFunction() = 0;'.
Explanation by: Ram Sharma
The correct way to define a pure virtual function is 'virtual void myFunction() = 0;'.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
105
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
95%
Success Rate