//myListErase.cpp #include #include #include using namespace std; int main() { string str1[] = {"New","A", "B", "C","D"}; int n1 = 0; list Lstr1(str1, str1+5); list:: iterator it; cout<<"\n Origianl string \n" ; for(it= Lstr1.begin(); it !=Lstr1.end(); it++) { cout <<" "<< *it; } //block that will erase the top elment cout<<"\n erase element from top \n "; Lstr1.erase(Lstr1.begin()); for(it= Lstr1.begin(); it !=Lstr1.end(); it++) { cout <<" "<< *it; } //block that will erase the top elment cout<<"\n erase element from top \n "; Lstr1.erase(Lstr1.begin()); for(it= Lstr1.begin(); it !=Lstr1.end(); it++) { cout <<" "<< *it; } return 0; }