Question: I saw that an array of pointers can be created using vector, however, I don't want that. Is the example below a way to create a pointer to int array?

```
#include <iostream>
using namespace std;

int main() {
    int* arr[4];
    for (int i=0; i<4; ++i) {
        cout<<endl<<arr[i];
    }
}

```

This makes a pointer to int array and it displays the memory address of each index in the array. Now I have few questions. Is it a proper way to create a pointer to int array without a vector? Also, if I want to initialize a value inside each memory address in the given example, how is it done? And lastly why is `&arr` equal to `arr`?

Answer: 
Your proposed way doesn't make pointer to int array. Instead of that it makes a pointer to pointer to an int array. Usually the name of any array represent a pointer to it self. Or `&arr[0]` also represent it.

So I hope that you got the answer for why `&arr` equal `arr`.

**Creating a pointer to int array**

```
int arr[4];
int* p = arr; //pointer to int array

```

**Initializing each element in array**

*(1) Using pointer arithmetic*

```
int size = 4;
int* p = arr;
for (int i = 0; i < size; i++)
{
    *p = i; // assigning each element i
    p++; //pointing to next element 
}

```

*(2) Using operator []*

```
int size = 4;
for (int i = 0; i < size; i++)
{
    arr[i] = i; // assigning each element i
}

```
&arr gives you the address of array which starts with base address ie address of first element.

arr gives the address of first element.

hence u get same result for both