Open In App

C++ | new and delete | Question 1

Like Article
Like
Save
Share
Report

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


Last Updated : 29 Jul, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads