// test string and vector // #include #include #include using namespace std; int main() { string ss; vector vv; // copy cin to cout, line-by-line // while( getline(cin,ss) ) { cout << "got line: " << ss << endl; vv.push_back(ss); // save the line } cout << "in reverse order:\n"; for( int i = vv.size()-1; i >= 0; --i) cout << vv.at(i) << endl; }