You are on page 1of 1

Make a greater than operator

Assignment Problems
A dynamic array, that you can add and remove entries from A type of container

Use unsigned int because v1.size() returns unsigned int. Iterator is a pointer Vector<thing>::iterator it; Acts like an array vector[5]; vector[5] = 10;

What is it? Iteration

Cheap adding at the end

Vectors in C++

Memory

Adding too much can become slow Needs to copy data to another place

Will throw exception


vector.at(); front(); back(); Resize push_back pop_back Add Memory Add/Remove Element Safer Access

Data Modification Declaration and Initialization


vector<type> varName ( initialSize , initialValue ); Good to keep initial value

You might also like