C++ Quiz

C++ Quiz

1 / 20

What is the difference between struct and class in C++?

2 / 20

Which of the following is the correct way to declare a pointer to an integer in C++?

3 / 20

What is the output of the following code?

int a = 5;int b = 10;std::cout << (a + b) << std::endl;

click on extem for view full code

 

4 / 20

Which of the following operators cannot be overloaded in C++?

5 / 20

What is a correct way to allocate memory dynamically for an array of 10 integers?

6 / 20

Which of the following is not a valid C++ data type?

7 / 20

What does the keyword virtual signify in a method declaration?

8 / 20

What is the use of the friend keyword in C++?

9 / 20

int x = 5;int& ref = x;ref = 10;std::cout << x << std::endl;

Click on Extem for view full code

10 / 20

Which of the following is the correct syntax to define a template class?

11 / 20

What does RAII stand for in C++?

12 / 20

Which of the following is not a valid C++11 feature?

13 / 20

What is the purpose of the std::move function in C++11?

14 / 20

What is a lambda expression in C++?

15 / 20

What is the output of the following code?

#include <iostream>void func(int a, int b = 20) {    std::cout << a << " " << b << std::endl;}int main() {    func(10);    return 0;}

Click on Extem for view full code

16 / 20

Which of the following is true about constructors in C++?

17 / 20

Which of the following is a correct statement about destructors in C++?

18 / 20

What does the override keyword indicate in C++11?

19 / 20

What is the difference between delete and delete[]?

20 / 20

Which of the following is a valid C++11 range-based for loop?

Your score is

The average score is 55%

0%

Scroll to Top