Saturday, February 28, 2009

C++ -- Standard Template Library

Vector:
1. In addition to operator [], vector defines the member function at() that checks the index. If the index is invalid, it will throw an object of class std::out_of_range. Code: 09Feb/feb28_1.cpp.
2. The assign() function will reinitialize vector. e.g., vec.assign(v0.begin(), v0.end()) or vec.assign(5,"Me")

Allocators:

No comments: