Home > Back-end > Two-dimensional array as a parameter, the calling function
Two-dimensional array as a parameter, the calling function
Time:06-04
Transposed matrix, can't call a function, z (x) can not call, teach, # include Int main () { Int I, j, m, n; Int x [100] [100]. Void z (int x [] [100]). The scanf (" % d % d ", & amp; M, & amp; n); for(i=0; ifor(j=0; JThe scanf (" % d ", & amp; [I] x [j]); Z (x); for(i=0; i{ for(j=0; JPrintf (" % 5 d, "x [I] [j]); printf("\n"); } }
Void z (int x [] [100]) { Int temp=0, I, j; for(i=0; i<100; I++) for(j=0; J<100; J++) { Temp=x [I] [j]; [I] [j]=x x [j] [I]; X [j] [I]=temp; } }
CodePudding user response:
Can try int * * x
CodePudding user response:
Please baidu dynamic array related knowledge, For example the following code
Int m=2; Int n=3; Int * * mArray=new int * [m]. for (int i=0; IMArray [I]=new int [m] (); }