GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Karteikarten

Vector

Ariel Sanchez Programming 12 Englisch 23 Karten

Karten in diesem Stapel (23)

  1. 1**VECTOR**.begin()return an iterator to the beginning of vector list
  2. 2**VECTOR**.end()return an iterator to the end of vector list
  3. 3std::vector::iterator sample = **VECTOR**.begin()create iterator variable and set value for vector list position
  4. 4**VECTOR**[i]Access Element at (i) the unsafe method
  5. 5**VECTOR**.at(i)Access Element of Vector with bounds checking
  6. 6**VECTOR**.front()access first element of vector list
  7. 7**VECTOR**.back()access last item of list
  8. 8**VECTOR**.data()access data **incomplete definition**
  9. 9**VECTOR**.assign() (elements, value) (adjVectorPosi1,adjVectorPos2) *iteratorslets you assign without pushback as if when first declaring the vector
  10. 10**VECTOR**.push_back()adds element to end of vector
    construct temp obj(copy) then moved to end of vector
  11. 11**VECTOR**.pop_back()deletes element at the end of vector list
  12. 12**VECTOR**.insert() (**VECTOR**.begin()) (**VECTOR**.begin(), pos1, pos2)insert element before position defined
    with optional param. overloading copy between to positions in different vector
  13. 13**VECTOR**.erase() (nthElement) (nth, mthElement)delete an item from vector
    at specified
    or range of nth -> m'th Elements
  14. 14**VECTOR**.swap(**VECTOR2**)swap entire vector contents
  15. 15**VECTOR**.clear()resets to an empty vector
  16. 16**VECTOR**.emplace(iterator, value)forward the value and construct in place no copies no moves
  17. 17**VECTOR**.emplace_back()forward and construct in place at end of vector no copy or moving
  18. 18**VECTOR**.size()returns integer with number of elements
  19. 19**VECTOR**.max_size()returns integer with max memory allocation possible *not max element size
  20. 20vector **VECTOR** () (**VECTOR2**) (#, value) (iteraStart,iteraEnd) {1,2,3,4}vector declaration with parameter overload syntax
  21. 21**VECTOR**.resize(intValue)size the container manually
  22. 22**VECTOR**.capacity()returns max amount of potential element storage without resizing
  23. 23**VECTOR**.empty()bool function checking for empty vector

Informationen

Beschreibung
Vector syntax, functions, and access members
Erstellt von
Ariel Sanchez
Aufrufe
92
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck