我读到这篇文章http://www.eskimo.com/~scs/cclass/int/sx5.htmlc。发送/返回阵列功能
但是这部分让我感到困惑:什么是返回在send_array_3
的数组,如果我们使用例如send_array
或send_array_2
已经修改它的意义呢?我们不需要退还它,对吧?
void send_array(int a[], int n) {
for (int i=0; i<n; i++)
a[i] = i*i;
}
void send_array_2(int* a, int n) {
for (int i=0; i<n; i++)
a[i] = i*i;
}
int* send_array_3(int a[], int n) {
for (int i=0; i<n; i++)
a[i] = i*i;
return a;
}
这些功能不会出现在链接中 – SheetJS