Lecture overview -- Keyboard shortcut: 'u'  Previous page: Vectors in C++ -- Keyboard shortcut: 'p'  Next page: The free store -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Alphabetic index  Help page about these notes  Course home    Basic facilities - slide 33 : 46

Vectors - examples

We provide a couple of program examples that use the template class vector

The first is similar to the initial array example

vector-1.cc
A simple vector example - similar to first array program.
vector-2.cc
Another vector example - constructors, insertion, lexicographic comparison.
vector-2-output
Program output.