📄 c04p223.txt
字号:
list<int> myList;list<int>::iterator curr;// right now, the list is empty;// start the iterator at the beginning of myListcurr = myList.begin();// test for empty listif (curr == myList.end()) cout << "The list is empty" << endl;// insert five items into the list myListfor (int j = 0; j < 5; j++) // places item j at the front of the list curr = myList.insert(curr, j);// now output each item in the list starting with the// first item in the list; keep moving the iterator// to the next item in the list until the end of// the list is reachedfor (curr = myList.begin(); curr != myList.end(); curr++) cout << *curr << " ";cout << endl;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -