2008-12-07 イテレータ C++ の使い方。 for (vector<int>::iterator i = vec.begin(); i != vec.end(); i++) { *i = 7; } 各要素はポインタのように扱えばおk。 参考: STL超入門