For compiler g++ on Linux, it doesn't work if I use
int **data = new int[m][n];
Can I new an array of int* first, and new an one-dimension array for the
first int*,
then use a loop to make every int* point to the right position?
int **data = new int*[m];
data[0] = new int[m*n];
for(i = 1; i < m; i++)
data[i] = data[0] + i * n;
It should works, however, it failed in my MPI program.
Could anyone give me a better method? Thanks.