I wanted to create a 2D integer array in the header file of my QT GUI APPLICATION with 2 columns and a yet to be defined (hence dynamic) number of rows.
So far I've got this: to make a dynamic array
QVector <qint8> ArrayName;
Can I use it as a 2D array or not? And, how would I call a certain row in a certain column later? e.g. ArrayName[40][2] ?
One could create a
QVector<QVector<qint8>>, but I would rather not go there: It’s unwieldy and not very efficient. I’d just fold the dimensions into a one-dimensional array: