Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
clusmore
· 10y ago · 0 comments
I think the advice that helped me the most was "Declaration follows usage".
int* arr[][10];
If you index twice into arr and then dereference, you'll get an int. So arr must be an array of array of pointer to int.
Comments
[–]
convales
10y ago
Declaration follows usage is much more easier to follow than the artificial spiral rules, IMHO with a few typedefs the declaration follows usage can make things pretty simple.
[–]
dllthomas
10y ago
To my mind that's one part of the reason the * belongs next to arr rather than next to int.
The other part is `int* x, y`.