#include <iostream>
using namespace std;
typedef int arr[8]; //利用typedef定义类型
int main( )
{
int a[8] = {1, 2, 3, 4, 5, 6, 7, 8};
void Func(arr &); //Func函数原型声明
Func(a); //调用Func函数
//system("pause");
return 0;
}
void Func(arr &x) //定义Func函数
{
for (int i = 0; i < 8; i++)
{ cout << x[i] << " "; }
cout << endl;
}
先利用 typedef int arr[8] 定义类型,然后利用arr类型就可以实现引用传参,对于需要大规模数据的调用时效率很高,不需要大量的复制操作。