English
Language : 

CC78K0S Datasheet, PDF (69/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 3 DECLARATION OF TYPES AND STORAGE CLASSES
char z[4][3] = {
{1}, {2}, {3}, {4}
};
In the next example, a three-dimensional array is initialized.
q[0] [0] [0] are initialized to 1, q[1] [0] [0] to 2, and q[1] [0] [1] to 3. 4, 5 and 6 initialize q[2] [0] [0], q[2] [0] [1], and
q[2] [1] [0], respectively. The rest of the elements are all initialized to 0.
short q[4][3][2] = {
{1},
{2, 3}
{4, 5, 6}
};
The following example produces the same result as the above initialization of the three-dimensional array.
short q[4][3][2] = {
1, 0, 0, 0, 0, 0,
2, 3, 0, 0, 0, 0,
4, 5, 6
};
The following example shows a complete definition of the above initialization using braces.
Short q[4][3][2] = {
{
{1},
},
{
{2, 3},
},
{
{4, 5, 6},
}
};
User’s Manual U14872EJ1V0UM
69