In C/C++, initialization of a multidimensional arrays can have left most dimension as optional. Except the left most dimension, all other dimensions must be specified.
For example, following program fails in compilation because two dimensions are not specified.
Following 2 programs work without any error.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Multidimensional Arrays in C / C++
- Initialization of variables sized arrays in C
- Zero Initialization in C++
- Uniform Initialization in C++
- Initialization of static variables in C
- Initialization of data members
- Implicit initialization of variables with 0 or 1 in C
- Initialization of global and static variables in C
- Multidimensional Pointer Arithmetic in C/C++
- How to print dimensions of multidimensional array in C++
- Why is a[i] == i[a] in C/C++ arrays?
- Arrays in C/C++
- Associative arrays in C++
- C | Arrays | Question 12
- C | Arrays | Question 5
- C | Arrays | Question 4
- C | Arrays | Question 2
- C | Arrays | Question 1
- C | Arrays | Question 6
- C | Arrays | Question 7