Open In App

C++ | new and delete | Question 1

How to create a dynamic array of pointers (to integers) of size 10 using new in C++?

Hint: We can create a non-dynamic array using int *arr[10]
(A) int *arr = new int *[10];
(B) int **arr = new int *[10];
(C) int *arr = new int [10];
(D) Not Possible

Answer: (B)
Explanation: Dynamic array of pointer having size 10 using new is created as,

int **arr = new int *[10]; 

So, option (B) is correct.
Quiz of this Question

Article Tags :