When auto is used against array, why it's converted to pointer and not reference?

Viewed 1361

See the below example:

int arr[10];
int *p = arr; // 1st valid choice
int (&r)[10] = arr; // 2nd valid choice

Now when we use auto against arr then, it chooses the 1st choice.

auto x = arr; // x is equivalent to *p

Is there a reason for choosing a pointer and not reference for array ?

4 Answers
Related