please explain the third question of mcq
Mcq of pointers
Due to some reasons, I cannot see the quiz question. Can you attach the screenshot of the question so I can help.
Q3 How can dynamic array of pointers(to integers) of size 100 can be created using new in C++? A) int *arr = new int *[100]; B) int **arr = new int *[100]; C) int *arr = new int [100]; D) int arr = new int [100];
@mehulbhandari358 The answer is int *arr = new int [100]
because *arr is a pointer, and 100xsizeof(int) is allocated dynamically by the compiler. This is the same as initializing it int the memory heap.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.