c++基础之new for
功能介绍循环最常见的的场景就是对数据集合的每一个元素进行某种操作。C++11之前,大致是这样的程序:int a[] = {1, 2, 3, 4};int sum = 0;for(int i = 0 ; i < sizeof(a)/sizeof(a[0]); ++i){ sum += a[i];}或者是这样vector v{1, 2, 3,4};int sum = 0;for(auto it = v.begin(); it != v.end(); it++){sum +=