Hi,
I need to store strings in a 2D array (table). Example:
car train bike
boat car scooter
bus ship shuttle
What is the best way to do it (I don't use GUI, it's a console application)? QVector or QList?
Does anyone have instructions for declaring and constructing a 2D array of strings? The contents (but not the size) of the 2D array changes a lot during the runtime.
Is this an acceptable way:
QVector<QString> *array[3];
for(i=0; i<3; i++) {array[i] = new QVector<QString>(3);}
QVector<QString> *array[3];
for(i=0; i<3; i++) {array[i] = new QVector<QString>(3);}
To copy to clipboard, switch view to plain text mode
But then how do I fill this with data. This did not work:
array[0][0]="hello";
array[0][0]="hello";
To copy to clipboard, switch view to plain text mode
Thanks!
Bookmarks