What is the main purpose of a pure virtual function in C++?
Weekly Contest #8 - TechXNinjas

Quiz
•
Computers
•
University
•
Hard
TechXNinjas undefined
Used 4+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
To provide a default implementation that can be overridden.
To enforce that derived classes must override the function.
To optimize the execution speed of virtual functions.
To allow multiple inheritance in C++.
2.
FILL IN THE BLANK QUESTION
1 min • 1 pt
What is the time complexity of this function for an input n?
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements about default arguments in functions is true?
Default arguments can be placed anywhere in the parameter list of a function.
Default arguments must be provided for all parameters of a function.
Default arguments must be specified from right to left in the parameter list.
Default arguments are mandatory for all overloaded functions.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following operators cannot be overloaded in C++?
+ (plus)
== (equality)
&& (logical AND)
[ ] (subscript)
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Will this code compile?
Yes
No
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements is correct about function pointers?
Function pointers can only point to functions that have no parameters.
Function pointers can only point to functions that return void.
Function pointers can point to member functions without any restrictions.
Function pointers can point to any function that matches the signature of the pointer type.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a disadvantage of using inline functions?
They decrease the execution time of the program.
They increase the code size due to code duplication.
They require more memory allocation for variables.
They cannot be used in header files.
Create a free account and access millions of resources
Similar Resources on Quizizz
15 questions
Exam 1 Practice

Quiz
•
University
7 questions
UNIT 5 Function Types

Quiz
•
University
15 questions
Python Basics

Quiz
•
KG - University
6 questions
Unit 12: Types of function

Quiz
•
University
15 questions
Microsoft Excel Functions

Quiz
•
University
10 questions
Functions

Quiz
•
8th Grade - University
10 questions
pointers and structures

Quiz
•
University
15 questions
C programming and Arduino Basics

Quiz
•
University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade