1
I have a matrix like this:
int numeros[qNum][6];
In reality it stores an integer number per line, separating the digits, for example:
I have the number 1234, in the matrix will be:
numeros[0][0] = 1;
numeros[0][1] = 2;
And so on and so forth. However, I have numbers composed of 4, 5 and 6 digits, as I do to define the matrix with dynamic columns, because this way the line 0 is not being 1234 but 123400. That is, it is always having 6 columns, filling the number I want and completing the rest of the columns with 0. How do I not do this, example have an array with the rows:
1234 14086 815108 No zeroes to mess with?
In this case 0 to the left is also worth something. Because in reality it is a game of hunting numbers (college work) so I’m putting these numbers in a matrix to then allocate them randomly in another matrix to generate the game board
– Leonardo
There is how I read an integer vector and store each digit typed in a position of it?
– Leonardo
You can experiment with a different value to mean empty position, for example,
-1
:numeros[0][0] = 1; numeros[0][1] = 2; numeros[0][2] = 3; numeros[0][3] = 4; numeros[0][4] = -1; numeros[0][5] = -1;
– pmg