# Name of arrays are constant pointers

imagine I tried this and got an error

can you do this in c?

```c
int a[] = {1, 2, 3, 4, 5};
a = a + 2;
```

No, you cannot do that in C.

The name of an array in C represents the address of its first element, and this address cannot be changed once the array has been declared. Therefore, the statement `"a = a + 2;"` is invalid in C.

If you want to access the third element of the array "a", you can use the subscript operator \[\] as follows:

```c
int a[] = {1, 2, 3, 4, 5};
int *ptr = &a[0];   // Get the address of the first element of the array
ptr = ptr + 2;      // Move the pointer two elements ahead which is 3
int third_element = *ptr;  // Access the third element of the array
```
