c++ standard library fill_n demo
2015-02-01 19:21
190 查看
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<int> ivec(10, 9); fill_n(ivec.begin(), 3, 0); for (vector<int>::iterator it = ivec.begin(); it != ivec.end(); ++it) { cout << *it << " "; } cout << endl; return 0; }
相关文章推荐
- c++ standard library algorithm count demo
- c++ standard library <numeric> accumulate demo
- Beyond the C++ Standard Library: An Introduction to Boost
- C++ Standard Library扩充建议...
- The C++ Standard Library 学习笔记(一)第6章
- Power up C++ with the Standard Template Library: Part I[翻译]
- Visual C++ Standard Library:next_permutation
- the boost graph library && Beyond the C++ Standard Library(boost中文版)
- Power up C++ with the Standard Template Library:Part II: Advanced Uses [翻译]
- The C++ Standard Library 学习笔记(一)第5章
- Beyond the C++ Standard Library: An Introduction to Boost -- Library 5.2 Usage
- Standard C++ Library Module User's Guide
- 《The C++ Standard Library》第39页 make_pair的作用
- [unresolved]《The C++ Standard Library》第50页 该如何理解exception to the rule
- 《The C++ Standard Library》第50页 关于传递auto_ptr的问题
- The C++ Standard Library Extensions: A Tutorial and Reference
- [unresolved]《The C++ Standard Library》第37页 pair的几种初始化
- 《The C++ Standard Library》第41页 不要误解了这段话
- Effective Standard C++ Library: for_each() vs. transform()
- Several Need-To-Know(assert/stdin/stdout/CString/Standard C++ Library)