If 'ptr' points to the first element of an array, what does 'ptr + 1' point to?
The size of the array
The next element in the array
The address of the array itself
The previous element in the array
What is the correct way to declare a multi-line comment in C++?
/* This is a multi-line comment */
' This is a multi-line comment '
// This is a multi-line comment
What is the correct way to declare an integer array named 'numbers' with a size of 5 in C++?
numbers[5] as int;
int numbers[5];
int numbers(5);
array numbers[5];
Which of the following is NOT a type of inheritance in C++?
Multilevel inheritance
Single inheritance
Multiple inheritance
Distributed inheritance
How can you prevent a C++ class from being inherited from?
By not defining any constructors
By using the 'abstract' keyword
By declaring it with the 'final' keyword
By making all its members private
What is a pure virtual function in C++?
A function with no implementation in the base class, meant to be overridden by derived classes
A function that creates new data types
A function that automatically destroys an object
A function that can be called before an object is created
How do you declare a multi-dimensional array (specifically, a 2D array) in C++?
int matrix(3)(4);
int matrix[3, 4];
array matrix[3, 4];
int matrix[3][4];
Which statement is used to skip the rest of the current iteration in a loop and jump to the next iteration?
break
skip
goto
continue
What is the purpose of the 'break' statement in a switch-case statement?
To jump to a specific case statement
To repeat the current case statement
To exit the switch-case statement
To skip to the next case statement
Which principle of OOP emphasizes hiding internal details and exposing only essential information?
Polymorphism
Encapsulation
Inheritance
Abstraction