Original: Initializing a multidimensional array
"C and Pointers" chapter 8th programming exercises 1th:
1 /*2 * * Initializes an array whose specific position is initialized to a specific value3 */4 5 StaticUnsignedCharchar_value[3][6][4][5] = {6{//07{//0,08{0}//0,0,09 }Ten }, One{//1 A{//1,0 -{0}//1,0,0 - }, the{// the -{0},//1,1,0 -{0,' '}//1,1,1 - }, +{// the -{0},//1,2,0 +{0},//1,2,1 A{0,0,0,'A'},//1,2,2 at{0,0,0,0,'x'}// the - }, -{//1,3 -{0},//1,3,0 -{0},//1,3,1 -{0,0,0xf3}//1,3,2 in }, -{//1,4 to{0},//1,4,0 +{0},//1,4,1 -{0,0,0,'\ n'}//1,4,2 the }, *{//1,5 ${0}//1,5,0Panax Notoginseng } - }, the{//2 +{//2,0 A{0}//2,0,0 the }, +{//2,1 -{0},//2,1,0 ${0,0,0320}//2,1,1 $ }, -{//2,2 -{0},//2,2,0 the{0,'0'},//2,2,1 -{0,0,'\ ''},//2,2,2Wuyi{0,'\121'}//2,2,3 the }, -{//2,3 Wu{0}//2,3,0 - }, About{//2,4 ${0},//2,4,0 -{0},//2,4,1 -{0},//2,4,2 -{0,0,'3',3}//2,4,3 A }, +{//2,5 the{0},//2,5,0 -{0},//2,5,1 ${0},//2,5,2 the{0,0,0,0, the}//2,5,3 the } the } the};
Initialize a multidimensional array