Wednesday, September 18, 2013

Vectors

Vectors look very useful - basically seem to be arrays you can extend. C++ reference is here. This is an excellent tutorial - part 1. A few basic points:
  • Indexing starts at zero and is done with [] brackets e.g. my_list[0]
  • Looks like there are some methods taking you to the beginning and end of the list
  • .set(value) one method to put stuff in an array
  • .push_back(value) adds on to the end so may be more useful
  • Can access with pointers as well as with []
  • Can be used with iterators

No comments:

Post a Comment