引用
#include<iostream> int main() { //变量的引用 int b = 13; int& c = b; int& d = c; //常量的引用必须是const const int & a = 12; std::cout << a << ' ' << c << ' ' << d << std::endl; //一维数组的引用 int arr[10]; int(&p)[10] = arr; p[2] = 15; std::cout << arr[2] << std::endl; //多维数组的引用 int arr1[3][4]; int(&p2)[3][4] = arr1; p2[1][2] = 16; std::cout << arr1[1][2] << std::endl; //指针的引用 int e = 17; int* point = &e; int* &f = point; *f = 18; std::cout << *point << std::endl; system("pause"); return 0; }