1.C++.基于范围的for循环
Form:
For example:
int numbers[] = {1,2,3,4,5,6,};
for(auto number:numbers){ // "auto" means that the compiler will infer the type of "numbers".
cout<<number<<' ';
}
The result of running the code is:1 2 3 4 5 6
.
The codes above is equivalent to: