动态创建一维数组
int *arr; //it can be any other type (char, float...) arr = new int[n]; //n should be integer variable
动态创建二维数组int **arr; int N,M; cin >> N >> M; arr = new int*[N]; for(int i=0;i<N;i++) { arr[i] = new int[M]; }
原作:
原文转自:http://www.ltesting.net