Lab #1 Using a vector of strings to store a source code program

 

Refresh your memory by reading the related sections in C++ Primer and the online MSDN document on the member functions of STL vector class. Create a C++ project and in the main function to work on the vector class to do things as described in the following.

 

Task #1: Manually store 3 lines of source code in a vector of strings

 

Task #2: Assess the elements by their indices

 

Task #3: Assess the elements using an iterator

 

Task #4: Use an iterator to delete some contents

 

Task #5: Use an iterator to insert new contents

 

Task #6: Clear the contents of the entire vector

 

Task #7: Use getline to read an arbitrary number of lines of source code into a vector of strings