ENGR 101 Lecture 19: Vectors
Document Summary
Engr 101: introduction to computers and algorithms - lecture 19: vectors. Often times we want to make lists of things that are not characters. Vectors can be used to make lists of anything: int, double, char, string. To declare a vector you have to specify the type you are making a list of. Typically we also want to tell how long this list will be: Can initialize the values in the list to: Individual parts of the list can be accessed using array semantics. Alternatively, the safer at() method to index the list. Other methods also exist to manipulate vectors: V. empty() true if the vector is empty.