I thought the program would fill mat[0][9] with the value 1 and the other positions would give some kind of error. But when I ran the program, the mat[0][9] position was filled with the value 1, after he met the first two elements of the second row with the value 1 also. Do not understand why he moved to the second line, the ones he should be filled mat[1][0] and mat[1][1]. Can anyone help me understand what happened? Thanks!
Remember that the way you created your array the array elements are contiguous in memory, so mat[1][0] follows mat[0][9]. But beware when you write past the end of the array (mat[9][10]) you would be in undefined behavior land.
I did a test showing the address of the position [0] [10] and position [1] [0] and the addresses were the same. It seems that once used a compiler that did this check, do not remember if it was in the old Turbo C or if it was a Pascal compiler. But it really was what you said, the matrix is, physically, a sequence of bytes. Representation in row and column is only a logical representation. Thanks jib!