Comment by tedunangst
14 years ago
I think it works if you treat all the [] as a single token. foo is a 3x4 two dimensional array of pointers to int.
14 years ago
I think it works if you treat all the [] as a single token. foo is a 3x4 two dimensional array of pointers to int.
You can construct a rule along those lines that would work (though just taking all the [] at once doesn't suffice), but it ends up being precisely equivalent to the right-left rule, so I don't really see the point.
I think the point is that the spiral rule is just a way to remember/implement the right left rule.
But its not, there are no two dimensional arrays. There are arrays of arrays.
Yes, but does it matter? We can call that a 2D array.
The sizeof operator begs to differ.
How does it differ? It just gives the size of the whole object -- that doesn't mean it's not an array of arrays...
2 replies →