例子 int arr[10]; for(int i=0;i<10;i++) { arr[i]=i; } //与上面for循环输出相同 for(auto &a:arr) { std::cout << a; }