Question: When I make an array of integer pointers, I tried this.

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

```

This did not work but the following worked.

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

```

Why do we need double pointer?? And when I deference it, I had to do the following.

```
cout<<arr[0];

```

Why we do not need \* in front of arr??
thanks!

Answer: 
`new int*[10]` allocates an array of ten pointers, and it yields a pointer to the first element of that array. The element type is **itself a pointer**, that's why you end up having a pointer to a pointer (to `int`), which is `int**`. And obviously `int**` isn't convertible to `int*`, so you have to declare `arr` with the appropriate type.
This statement is an expression for an 1D array of int

```
int* arr = new int [10]; // pointer to array of 10 int

```

This statement is an expression for a 2D array of int

```
int** arr = new int* [10]; // pointer to 10 pointers to arrays of 10 int

```

To populate the 1D array, you need to do this...

```
for (int i = 0; i < 10; i++) {
        arr[i] = val; // where val can be any integer
}

```

To populate the 2D array, you need to do this...

```
int** arr2 = new int*[10];
for (int i = 0; i < 10; i++) {
    arr2[i] = new int[10];
    for (int j = 0; j < 10; j++) {
        arr2[i][j] = val; // where val can be any integer
    }
}

```

The \* symbol between the variable type and the variable name is syntax for pointer. It changes type from *int* to *pointer of int*.