Possible Duplicate:
How do I use arrays in C++? (FAQ)
Using dynamic multi-dimensional arrays in c++動態分配一個二維數組
void fillTestCase (int * tC)
{
ifstream infile;
infile.open("input00.txt",ifstream::in);
int * tempGrid;
int i,j;
infile >>i;
infile >>j;
tempGrid = new int[i][j];
}
給我一個錯誤:
error C2540: non-constant expression as array bound
error C2440: '=' : cannot convert from 'int (*)[1]' to 'int *'
我怎樣才能使這個兩個維動陣列的動態?
首先相關的問題:http://stackoverflow.com/questions/1471721/using-dynamic-multi-dimensional-arrays-in-c?rq = 1 – chris 2012-07-07 20:08:13
只是拋出它:如果可以的話,請使用'std :: vector'。 – chris 2012-07-07 20:14:57
SO的C++ FAQ條目___ [如何在C++中使用數組?](http://stackoverflow.com/questions/4810664/how-do-i-use-arrays-in-c)___有幾個段落在多維數組上。 – sbi 2012-07-07 20:18:18