直接上代码
参考:https://www.cnblogs.com/gamesky/archive/2012/08/22/2650820.html
#include <iostream>
int * test(int array[]){
cout << array << endl; // 0xffffcb90
cout << array[0] << endl; // 0
array[3] = 100;
return array;
}
int main(){
int length = 4;
int in_a[length] = {0};
cout << in_a << endl; // 0xffffcb90
int *p;
p = test(in_a);
cout << p << endl; / /0xffffcb90
cout << in_a[3] << endl; // 100
cout << p[3] << endl; // 100
}