Oop3 BECTORS Flashcards
1
Q
What library is needed for vectors?
A
<vector>
</vector>
2
Q
How do you declare vectors?
A
std::vector<dataType> foo(size);</dataType>
3
Q
How do you declare vectors?
A
std::vector<type>foo(size);</type>
4
Q
.push_back();
A
Adds an element to the vector
5
Q
How to declare an iterator?
A
std::vector<int> myVector(10);
…
std::vector<int>::iterator iter = my vector.begin();</int></int>
6
Q
How do you get the actual variable from the current iterator position?
A
Dereference it *iterator
7
Q
How to get the end iterator?
A
myVector.end();