Q 11. What does the 'sizeof' operator do in C++?
A. Returns the size of the variable in bytes
B. Returns the size of the pointer
C. Returns the number of elements in an array
D. Allocates memory space for a variable
Q 12. Which of the following is used to release dynamically allocated memory in C++?
A. delete
B. free
C. malloc
D. release
Q 13. Which of the following C++ features allows you to access private members of a class from outside the class?
A. Friend function
B. Inheritance
C. Encapsulation
D. Polymorphism
Q 14. Which of the following statements about C++ destructors is correct?
A. A destructor is called explicitly by the programmer.
B. A destructor has the same name as the class but with a tilde (~) prefix.
C. A destructor can have parameters.
D. A destructor cannot be virtual.
Q 15. Which of the following is the correct way to define a function that accepts a pointer as an argument in C++?
A. void function(int *ptr);
B. void function(int ptr*);
C. void function(*int ptr);
D. void function(int& ptr);