Matrix with dynamic columns?

1

I have an array like this: int numeros[qNum][6];

In fact it stores an integer by line separating the digits, eg:

I have the number 1234, in the array will be: numeros[0][0] = 1; numeros[0][1] = 2;

And so on. But I have numbers composed of 4, 5 and 6 digits, how do I define the matrix with dynamic columns, because that way line 0 is not 1234 but 123400. That is, it is always having 6 columns, filling in the number that I want and completing the rest of the columns with 0. How do I not do that, example having an array with lines:

1234 14086 815108 No zeros to get in the way?

    
asked by anonymous 08.10.2015 / 16:58

1 answer

0

Move left zeros

// 1234
numeros[0][0] = 0; numeros[0][1] = 0; numeros[0][2] = 1;
      numeros[0][3] = 2; numeros[0][4] = 3; numeros[0][5] = 4;

// 14086
numeros[1][0] = 0; numeros[1][1] = 1; numeros[1][2] = 4;
      numeros[1][3] = 0; numeros[1][4] = 8; numeros[1][5] = 6;

// 815108
numeros[2][0] = 8; numeros[2][1] = 1; numeros[2][2] = 5;
      numeros[2][3] = 1; numeros[2][4] = 0; numeros[2][5] = 8;
    
08.10.2015 / 17:09