In a facebook group, I saw a question like :
If a row dominated two dimensional array in the following which one is advantage and why?
Variant (a) is better, since it's much more cache-friendly, than (b): you access consecutive elements, so there are less cache misses. However, some compilers can rearrange your loops, so when compiled both variants might produce same machine codes.
Besides performance, there is no difference between this two variants, i.e. thay produce the same output.