4 ms·
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
by clusmore 10y ago
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.
- convales 10y agoDeclaration 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 agoTo 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`.