我想将一个名为aArray1 [51] [4]的2dim数组传递给一个函数。函数作业交换2行数组。我想知道在将aArray1传递给该函数之后,aArray1是否也发生了变化,或者我应该做些什么来在函数结束时将该交换转移到aArray1?
答案 0 :(得分: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