Hello All,

1D and 2D arrays with QVector can be declared as follows:

QVector< int > myA1D;
QVector<QVector<int> > myA2D;

and I can use them: myA1D[i] and myA2D[i][j].

I need to get pointers of them because the pointers should be given to Fortran codes.

For 1D, we can do....

int *pA1D = myA1D.data();

For 2D, How to get the pointer?

int **pA2D = ????

Could someone help me? Please!



I could do it by using additional memory spaces (Not verified yet);

QVector<QVector<int> > myA2D;
QVector< int* > tempPtA2D;
int **pA2D;

- tempPt2D[0] = myA2D[0].data() ....;
- pA2D = tempPt2D.data();
- int aaa = pA2D[][];

But it uses additional memory spaces, which I don't like.

Please let me know good techniques or other libraries for me.
- I would like to avoid "using new and delete to generate 2D array." (That's why I want to use QVector.)

Thank you.