Re: [Dev-C++] two-dimensional arrays
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ricardo R. <ri...@un...> - 2003-05-02 10:31:21
|
you dont need to swap the both matrices, you can easily switch from one matrix to the other with a pointer, as follows: ************************************** int matrix1 [ N ] [ M ]; int matrix2[N][M]; int *q = matrix1[0]; matrix1[1][0]=8; cout << matrix1[1][0] << *(q+3); q = matrix2[0]; matrix2[1][0]=9; cout << matrix2[1][0] << *(q+3); ******************************** |