For instance, I have a 2-D array:
1 2 3 4 5
6 7 8 9 10
11 12
It's an 3 by 5 array. However, in the third row, I only need to fill two cells. The remaining ones are unnecessary, but it's created when initializing the array.
The reason I want to so this is that my actual array's row is very long, so that potentially wastes a big chunk of memory, because i only need to use two cells in the 3rd row.
Is there a way to shorten the third row to contain two cells only after the array is filled up?
I am not sure it's possible, or it's the best way to do it. Thank you.