123456789101112131415161718192021222324252627 |
- int** multiArray(int width, int height) {
- int** array = new int*[width];
- for(int x = 0; x < length(array); x++) {
- array[x] = new int[height];
- for(int y = 0; y < length(array[x]); y++) {
- array[x][y] = y + x * height;
- }
- }
- return array;
- }
- void deleteMultiArray(int** array) {
- for(int x = 0; x < length(array); x++) {
- delete array[x];
- }
- delete array;
- }
- void main() {
- int** array = multiArray(2, 3);
- for(int x = 0; x < length(array); x++) {
- for(int y = 0; y < length(array[x]); y++) {
- test(array[x][y]);
- }
- }
- deleteMultiArray(array);
- }
|