Google News
logo
CPP - Quiz(MCQ)
What is the correct syntax of declaring array of pointers of integers of size 10 in C++?
A)
int **arr = new int*[10];
B)
int *arr = new int[10];
C)
int *arr = new int*[10];
D)
int arr = new int[10];

Correct Answer :   int **arr = new int*[10];


Explanation : As we have to declare an array of pointers of integers therefore we need double pointer array in which each element is collection pointers to integers. Therefore the correct syntax is int **arr = new int*[10];

Advertisement