Pointers to pointers — C++ MCQs 20 Score: 0 Attempted: 0/20 1. What is a pointer to pointer? (A) A pointer storing an array address (B) A pointer storing address of another pointer (C) A pointer storing integer value (D) None of these 2. How do you declare a pointer to pointer for an int? (A) int *p; (B) int *p; (C) int &p; (D) int p; 3. If int a = 5; int *p = &a; int **q = &p;, what does **q give? (A) Address of a (B) Garbage (C) Address of p (D) 5 4. Which of the following is correct to assign pointer to pointer? (A) **p = &a; (B) int *q = &p; (C) int **q = &p; (D) int &q = &p; 5. What is output of the code?int a = 10;int *p = &a;int **q = &p;cout << *p << " " << **q; (A) 10 10 (B) Address Address (C) 10 Address (D) Address 10 6. Pointer to pointer is useful for (A) Dynamic memory allocation (B) Passing pointer to function and modifying it (C) Creating multi-level pointers (D) All of the above 7. How do you declare a pointer to pointer to pointer (triple pointer)? (A) int ***p; (B) int **p; (C) int *p; (D) int &p; 8. Which of the following is INCORRECT? (A) int a = 5; int *p = &a; int **q = &p; (B) int **q = &a; (C) **q = 10; (D) cout << **q; 9. If int a=7; int *p=&a; int **q=&p; which of the following changes the value of a? (A) *p = 10; (B) **q = 20; (C) Both A and B (D) None 10. What does q store in int **q = &p;? (A) Address of int variable (B) Address of pointer p (C) Value of int variable (D) Garbage 11. How do you pass a pointer to a function so that it can modify the original pointer? (A) Pass pointer normally (B) Pass integer (C) Pass reference (D) Pass pointer to pointer 12. Which of the following is TRUE? (A) A pointer to pointer can be NULL (B) Pointer to pointer can store address of pointer (C) Pointer to pointer can be incremented (D) All of the above 13. Output of the code?int a=3;int *p=&a;int **q=&p;cout << p << " " << *q; (A) Address Address (B) 3 3 (C) Address 3 (D) 3 Address 14. What type should a function parameter have to modify a pointer? (A) int * (B) int ** (C) int (D) int & 15. How to access the value of variable a using pointer to pointer? (A) *p (B) **q (C) &a (D) *q 16. Which of the following declarations is valid? (A) int **p, *q; (B) int *p, **q; (C) int ***p; (D) All of the above 17. If int a=1, *p=&a, **q=&p; what does *q store? (A) Address of a (B) Value of a (C) Address of p (D) Garbage 18. Which of the following increments pointer to pointer? (A) q++ (B) *q++ (C) **q++ (D) None 19. Can a pointer to pointer point to NULL? (A) Yes (B) No (C) Only in C++11 (D) Only for integer pointers 20. Which statement is correct about pointer to pointer? (A) It can only point to int pointers (B) It can point to any type of pointer (C) It cannot store NULL (D) It cannot be dereferenced Related Posts:Pointers Solved MCQs Questions AnswersPointers and arrays — C++ MCQsPointers to functions — C++ MCQsPointers Easy TutorialPointers exercises with solutions in C++How to use Pointers in Structure? C++