In a previous episode, we have seen one-dimensional dynamic array, that is, dynamic arrays of values. For example, the different ages of this course's students. How should we proceed in order to represent multi-dimensional arrays? For example, an array of all the grades of all the students for for all exams. For example, we could build an array for one student containing the different grades for the different exams. Then build a second array for another student, also containing the grades for all their exams. Then build a third array and so on. Globablly, we would thus have an array of ... arrays. Each element of this array being an array of grades itself. For example, let us suppose that we wish to have an array for 5 students. And that, for example, each of these students will have passed 6 exams. Finally, we thus have 6 grades. We will thus end up with a dynamic array of 5 arrays of 6 marks. We will thus declare a dynamic array which we will call "tab". This dynamic array will itself contain a dynamic array of integers. The integers are our grades. The dynamic array of integers is the array of a student's grades. And the dynamic array of the dynamic arrays of integers is the array of the arrays of all the students. We will initialize it to the number of students. We have 5 students here. What is each of these 5 element actually? It is itself a dynamic array of integers, representing a student's grades. Each of these elements will contain 6 grades. Finally, we have a dynamic array containing 5 dynamic arrays of 6 grades. The syntax used here in order to give an initial value to each array of grades, each student, each subarray is the same as the one we have already encountered during the copy of an array. It is the anonymous array. It is like writing : " vector <int> tab2 ", initialized with 6 ints, all with the initial value zero except that we have suppressed the name. We thus end up with an anonymous array. Here, we did not name our dynamic array of 6 null integers. Now, let us look at our dynamic array of dynamic arrays of integers that we have declared here and called "tab". " tab[i] " is thus an element of this dynamic array corresponding to an array of grades. " tab[i] " is thus a itself a dynamic array of integers, It corresponds to the type we have given here : a dynamic array of integers. Also, we have given the initial value here. Thus "tab[i]", for example "tab[0]" is this array of 6 integers. " tab[i][j] " is the element at the position "j". Therefore, it means that it is the (j+1)th element of the "tab[i]" array. Thus, starting from this array here, the dynamic array of dynamic arrays of integers, if we take "tab[i]", " tab[i] " is itself a dynamic array of integers. We are looking for the (j+1)th element, the element at the position "j". As usual, we represent " tab[i] [j] " as the element on the (j+1)th row and (j+1)th column. We do not need to forget that, here, we have a dynamic array of dynamic arrays of integers. The dynamic aspect of these rows is still there; indeed, each of the rows may have elements added or removed from it. Finally, this means that the dynamic array of dynamic arrays does not necessarily have rows of the same size. For example, we may very well have a first size for " tab[0] " here (it is indeed a dynamic array of integers), a different size for " tab[1] " (a second dynamic array of integers) and so on. Let us now thoroughly look at this example. We will thus declare a dynamic array of dynamic arrays of integers. We will call it, for example, "tableau". (TN: "tableau" means "array"). If we wish to initialize it to the value of the example we have drawn here, what we will do is to give an initial value as a list of elements. Each of these elements being a dynamic array of integers. We can see the first row here. Then the second row and so on for the third row and the fourth row of our dynamic array of dynamic arrays of integers. This initialization corresponds exactly to the drawing here on the right. A little digression regarding the syntax : When we declare a dynamic array of dynamic array of integers, we need here to glue together the closing of the two types with the two "greater than" signs, glued together like this. This is only allowed in C++ 2011. If need to write it in a compiler which is not C++ 2011, then you will have to put a blank space between these two signs here. Indeed, the syntax with the two "greater than" signs glued together like this is not supported by older compilers. Now, let us see how to go through this array. For that, we will use a C++ 2011 loop with the colon. The array we wish to go through is "tableau" here. Here, we are declaring the variable which will go through the rows. We call it "ligne". (TN: "ligne" means "line" or "row"). This will let us go through the array row by row. Then, going through a row, we will explore all the elements of a given row. For example, if we are on the first row, we will then go through the different elements of this line here in a second "for loop". This loop will, this time, go through the array "ligne" we have declared here which is a given line. We will go through this row, naming it "element". This "element" variable will go through the different elements of a row. This is what we have written here. We can then use this "element" variable in order to go through the different elements of a row. Finally, let us illustrate the fact that the elements of the array are indeed dynamic arrays by giving the size of the different rows of the different dynamic arrays. To that end, we will use a usual "for loop". As usual, we will start with " i ", declared as a "size_t" to the value 0. As long as " i " is less than the array size (the array we are talking about, the initial array, here), as we have done countless times, " i " will be incremented 1 by 1. What we will do is to print " tableau[i] ". Thus, we will print "tableau[0].size() ", "tableau[1].size() " and so on. Then, we can use, as such, "tableau[i]" which as array ".size()", returning the size of the array. The following will thus be printed : 5 for " tab[0].size() " , 3 for " tab[1].size() " , 2 for " tab[2].size() " , and, finally, 3 again for " tab[3].size() " .