Hacker News new | past | comments | ask | show | jobs | submit login

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.



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.


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`.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: