Been awhile since I’ve programmed in C++ however I have a slight problem that I’m trying to figure out.
Is it possible to make a 2 by 2 dynamic array where 1 dimension is not dynamic?
For example
array[2][Dynamic]?
It seems like a waste to make array[dynamic][dynamic] and when I only need to use the first [0][dynamic] and second [1][dynamic] values.
Should I use another data structure?
Thanks.
Arrays and pointers are basically equivalent, so you can achieve this with an array of pointers:
You can still access it as you would multidimensional array: