int main() {
int myarr[5] = {1, 2, 3, 4, 5};
double myval1, myval2;
myval = myfun1(myarr, 100); // myarr is unchanged
myfun2(&myarr, 200); // myarr now has new values
return 0;
}
double myfun1(int *arr, int para1) {
// @TODO1
}
void myfun2(int *arr, int para2) {
// @TODO2: here you can change value of *arr which is returned back to the calling function
}
myarr
可以更改为您想要的任何类。