I just build my fist LED cube and want to expand the test code a bit. To address each LED of my 3x3x3 cube I want to use a corresponding three-dimensional array, but I got errors on its initialization.
Here's what I did:
int cube_matrix[3][3][3] =
{
{ {0}, {0}, {0} },
{ {0}, {0}, {0} },
{ {0}, {0}, {0} }
},
{
{ {0}, {0}, {0} },
{ {0}, {0}, {0} },
{ {0}, {0}, {0} }
},
{
{ {0}, {0}, {0} },
{ {0}, {0}, {0} },
{ {0}, {0}, {0} }
};
Here's the error I get:
error: expected unqualified-id before '{' token
I could use a for
loop to initialize my array and get things done but my initialization seems correct to me, and I want to know what I did wrong.