This just doesn't make sense:
QVector<QVector<int> > myA2D;
QVector< int* > tempPtA2D;
int **pA2D;
- tempPt2D[0] = myA2D[0].data() ....;
- pA2D = tempPt2D.data();
- int aaa = pA2D[][];
QVector<QVector<int> > myA2D;
QVector< int* > tempPtA2D;
int **pA2D;
- tempPt2D[0] = myA2D[0].data() ....;
- pA2D = tempPt2D.data();
- int aaa = pA2D[][];
To copy to clipboard, switch view to plain text mode
Can you tell me which part is wrong?
The following codes work:
QVector<QVector<int> > test2D;
test2D.resize(10);
for(int i=0; i<10; ++i)
{
(test2D[i]).resize(5);
}
for(int i=0; i<10; ++i)
for(int j=0; j<5; ++j) test2D[i][j] = 3*i+j;
yes, that 'works', but you cannot pass anything there to a fortran routine that expects a 2d array (int[][] for example).
Also, please use code tags in future.
Bookmarks