11. What is the purpose of a null pointer in C++? A. Represents a pointer to a reserved memory location B. Represents a pointer to a deleted object C. Represents a pointer to a null object D. Represents that the pointer does not point to a valid object Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
12. What is the output of the following code: int arr[3] = {1, 2, 3}; int *ptr = arr; cout << *(ptr + 1); in C++? A. 1 B. 3 C. 2 D. Garbage value Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
13. What is a dangling pointer in C++? A. A pointer that points to a null value B. A pointer that points to a deallocated memory C. A pointer that points to a reserved memory location D. None of the above Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
14. What is the address-of operator in C++? A. * B. -> C. :: D. & Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
15. What is the output of the following code: int arr[] = {1, 2, 3}; cout << *arr; in C++? A. 1 B. 2 C. 3 D. Compilation error Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
16. How do you declare a constant pointer to an integer variable in C++? A. const int * const ptr; B. const int *ptr; C. const *int ptr; D. int *const ptr; Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
17. What is a pointer to a pointer known as in C++? A. Reference pointer B. Pointer pointer C. Double pointer D. Nested pointer Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
18. What does the 'new' keyword do in C++? A. Declares a new variable B. Allocates memory dynamically C. Returns the size of a variable D. None of the above Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
19. What is a null reference in C++? A. A reference with a null value B. A reference initialized with nullptr C. A reference that doesn't refer to any object D. A reference that refers to a null object Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
20. What is the output of the following code: int x = 10; int *ptr = &x; cout << *ptr << " " << ptr; in C++? A. 10 Memory address of x B. 10 Value of x C. Compilation error D. 10 Address of x Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board