August 2012
Intermediate to advanced
976 pages
30h 17m
English
vector TypeA vector
is a collection of objects, all of which have the same type. Every object in the collection has an associated index, which gives access to that object. A vector is often referred to as a container because it “contains” other objects. We’ll have much more to say about containers in Part II.
To use a vector, we must include the appropriate header. In our examples, we also assume that an appropriate using declaration is made:
#include <vector>using std::vector;
A vector is a class template. C++ has both class and function templates. Writing a template requires a fairly deep understanding of C++. Indeed, we won’t ...
Read now
Unlock full access