Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

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];

Answer: b
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];

Join The Discussion