// example of using STL vector class: // define a vector of string objects, put some strings into it // (from standard input), and print them out. #include <iostream.h> #include <vector> #include <string> int main() { vector <string> v; string tempS; cout << "Enter some words, control-D to end:\n"; while(cin>>tempS) { v.push_back(tempS); } cout << "\nYou entered:\n"; int i=0; while(i<v.size()) { cout<<v[i]<<endl; i++; } return 0; }