#include "stdafx.h" #include <iostream> #include <vector> #include <string> using namespace std; int main() { vector<string *> p; string str; cout<<"Enter the string (end with the ctrl+Z)"<<endl; while(cin>>str) { string *st=new string; *st=str; p.push_back(st); } vector<string *>::iterator iter=p.begin(); while (iter!=p.end()) { cout<<**iter << (**iter).size() <<endl; ++iter; } iter=p.begin(); while(iter!=p.end()) { delete *iter; ++iter; } return 0; }