01: #include <string> 02: #include <list> 03: #include <iostream> 05: using namespace std; 06: 07: int main() 08: { list<string> staff; 10: 11: staff.push_back("Cracker, Carl"); 12: staff.push_back("Hacker, Harry"); 13: staff.push_back("Lam, Larry"); 14: staff.push_back("Sandman, Susan"); 15: 16: /* add a value in fourth place */ 18: list<string>::iterator pos; 19: pos = staff.begin(); 20: pos++; 21: pos++; 22: pos++; 24: staff.insert(pos, "Reindeer, Rudolf"); 25: 26: /* remove the value in second place */ 28: pos = staff.begin(); 29: pos++; 31: staff.erase(pos); 32: 33: /* print all values */ 35: for (pos = staff.begin(); pos != staff.end(); pos++) 36: cout << *pos << "\n"; 37: 38: return 0; 39: }