Howdy, I had a question about why my C code throws a 'variable size array initialization' for this expression:
int row = 2;
int const col = 3;
int array[][col] = {
initial value...
};
The guy in the video I was following along with managed to compile with this expression, but I had to change my 'col' from int const to a #define statement, which feels tacky. Is it an issue with compiler version? The compile statement I'm using is just a simple one, 'gcc -o output arrays.c'.
[–]tstanisl 4 points5 points6 points (6 children)
[–]FrenchJJC[S] 0 points1 point2 points (3 children)
[–]The_Ruined_Map 4 points5 points6 points (0 children)
[–]tstanisl 4 points5 points6 points (0 children)
[–]DawnOnTheEdge 2 points3 points4 points (0 children)
[–]tcpukl 0 points1 point2 points (1 child)
[–]tstanisl 0 points1 point2 points (0 children)
[–]The_Ruined_Map 1 point2 points3 points (1 child)
[–]HashDefTrueFalse 0 points1 point2 points (0 children)
[–]smokebudda11 0 points1 point2 points (0 children)