Re:Arrays of Arrays (2009)
by Per_Bothner on Sunday December 20, 2020 @06:57AM
(#25485667)
Which is why the sane way to do it is to have the array-specifier come before the element type:
[,][]int crazy;
It reads "2-dimensional array of array of int" in L-to-R order.
Similarly, the type "pointer-to-int" should be "*p" or equivalent.
Unfortunately, history/tradition as well parsing problems make the "sane" solution difficult. One solution is the Pascal approach putting the type after the variable being declared, with a colon between:
Similarly, the type "pointer-to-int" should be "*p" or equivalent.
Unfortunately, history/tradition as well parsing problems make the "sane" solution difficult. One solution is the Pascal approach putting the type after the variable being declared, with a colon between: