On 04/23/2017 12:04 PM, XavierAP wrote: > For both multi-dimensional and > uni-dimensional arrays a[] and a[][] are the same. And yet, a[] has > different type in both cases and a[]=1 compiles for uni-dimensional but > not for multi-dimensional.
I think it's still consistent because the element type is not int in the case of multi-dimensional arrays. The following makes sense to me but I haven't profiled it. Otherwise, kinke's solution is perfectly fine in a system programming language. ;)
int[3] a; a[] = 1; a[][] = 1; // Same effect int[3][4] b; b[] = [1, 1, 1]; b[][] = [1, 1, 1]; // Same effect Ali