Bad approach with lots of data
int nota2;
int nota3;
int nota4;
int nota5;
This becomes repetitive, hard to maintain, and later it is very difficult to traverse or process the information.
This presentation is designed for someone just starting out. We go from the problem of having many separate variables to understanding why an array organizes data better and how a matrix adds rows and columns.
int notas[5] = {8, 9, 6, 10, 7};Because having many separate variables is chaos. An array lets you store several values of the same type under a single name and access each one using its position.
This becomes repetitive, hard to maintain, and later it is very difficult to traverse or process the information.
notas.notas[0], notas[1], etc.A one-dimensional array can be thought of as a single row. It has several positions but only one dimension. The important thing is to understand that the index starts at <strong>0</strong>.
numeros[0] is 10.numeros[2] is 30.Don't think "5 values → last index 5". That's a classic mistake. Think like this: <strong>count = 5</strong>, <strong>last index = 4</strong>.
Here you can see how an array is filled with a loop. Notice that we don't write one line per position: we let the index do the repetitive work.
When one row is not enough, the matrix appears. A matrix is an array with two dimensions. To access its data you need two indices: one for the row and one for the column.
That access returns <strong>6</strong>, because row 1 is the second row and column 2 is the third column.
Think of it as a table: first you choose the row, then the column. If you mix up that order, you get lost.
If the data can be imagined as a single list, use a one-dimensional array. If the data is organized like a table, use a matrix.
numeros[5] in an array of 5 elements. An array in C is not just "many data together". It is an orderly way of representing related information. When you understand that each data has a position and that position is accessed by index, you start thinking about problems better.
And when a second dimension appears, the idea does not change: you simply go from a list to a table. No magic. Just data organization.