The syntax to declare a pure virtual function is to follow the function declaration with _______.
- '= 0'
- 'virtual'
- 'override'
- '= 1'
In C++, a pure virtual function is declared by assigning 0 in its declaration. The syntax is virtual function_name() = 0;. It indicates that the function doesn't have a body in this class and must be implemented in any non-abstract derived class.
Loading...
Related Quiz
- You're designing a calendar application and need to determine if a year is a leap year. Leap years are divisible by 4 but not divisible by 100 unless they are also divisible by 400. Which arithmetic operators are crucial for this determination?
- Which of the following scenarios is the most suitable for using a break statement in a professional codebase?
- You are debugging a C++ application and find that a goto statement is causing erratic jumps and consequently, unexpected behavior. Which refactoring approach might be the most beneficial to enhance code readability and maintainability?
- Creating user-defined exceptions in C++ can be achieved by inheriting the _______ class.
- The _______ function is used to move the file pointer to a specified position in the file.