编辑代码

#include <iostream>
using namespace std;
void test()
{
    int arr[10];
    for(int i=0;i<10;i++)
    {
        arr[i]=i;
    }
    //方式①给数组起别名
    int(&pArr)[10]=arr;
    for(int i=0;i<10;i++)
    {
        cout<<pArr[i]<<" ";
    }
    cout<<endl;
    //第②种方式给数组起别名
    typedef int ARRAYREF[10];
    ARRAYREF& pArr2=arr;
    for(int i=0;i<10;i++)
    {
        cout<<pArr2[i]<<" ";
    }
    cout<<endl;

}
int main() {
    //JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。 
	//cout << "Hello JSRUN!   \n\n         - from C++ ." << endl;
	test();
    system("puase");
    return EXIT_SUCCESS;
}