Skip to content
UniCircle
EasyConceptualPointers and arrays

Are arrays and pointers the same thing in C?

Question C-PTR-001

An interviewer writes int a[10]; int *p = a; and asks: "So a and p are the same, right?" Explain how arrays and pointers are similar and how they differ.

Show the explanation

No. They behave alike in many expressions, but they are different things.

What is the same

  • In most expressions an array name decays to a pointer to its first element. So p = a is legal, and a[i], *(a + i), p[i] and *(p + i) all mean the same element.
  • When you pass an array to a function, the function receives only a pointer. void f(int a[]) is exactly void f(int *a).

What is different

int a[10];int *p = a;
What it is10 ints stored togetherone variable that holds an address
sizeof10 * sizeof(int) (often 40)size of a pointer (often 8 on 64-bit)
Can be reassigned?No: a = something does not compileYes: p++ or p = other
&x givesint (*)[10], a pointer to the whole arrayint **

Where decay does not happen: with sizeof a, with &a, and when a string literal initialises a char array.

The trap interviewers aim for: inside a function, sizeof(arr) / sizeof(arr[0]) does not give the length of the array that was passed in, because arr is only a pointer there. That is why C functions take the length as a separate parameter.

Original UniCircle question. Last reviewed 22 Oct 2026.