0

I want to pass a 2dim array called aArray1[51][4] to a function. The function job is swapping 2 rows of array. I want to know that after passing aArray1 to that function Is aArray1 changed too or I should do something else to transfer that swapping to the aArray1 in the end of function?

4

1 回答 1

0
int*** myfunction(int*** aArray1Address){
// do stuff with:  *aArray1Address
 return aArray1Address;
}


int** aArray1 = initializeWithData();

int*** result = myfunction(&aArray1);

compare(*result ,  aArray1 ) // will be the same content because you have passed his address
于 2013-08-20T19:06:39.957 回答