AsianDuckKing AsianDuckKing - 1 year ago 56
C Question

How can I understand int *a[5][5]?

I got a task to modify the content of a 2-dimensional array

, I was given the definition
int *a[5][5]
and ordered to use a
(the pointer of a pointer) to handle this task.

I'm now wondering the meaning of this
int *a[5][5]
, how can I understand the meaning of this and similar definitions?

Answer Source

int *a[5][5] is a 2D array of pointers. A pointer-to-pointer can be used to point at any pointer item in this array.

A for how to understand the declaration, everything left of the variable name is the type of each item in the array, in this case int*.

You could also use this site. It works for many C declarations, but not all.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download