📄 e06-03.cpp
字号:
// =======================================================
// Chapter 6, Example 3
// Using the SLinkedList and SListIterator classes
// =======================================================
#include "SLinkedList.h"
#include <iostream.h>
void main()
{
// create a new linked list.
SLinkedList<int> list;
// insert 10, 20 and 30.
list.Append( 10 );
list.Append( 20 );
list.Append( 30 );
cout << "the list contains: ";
// create a new iterator, and make it point to the
// beginning of the list.
SListIterator<int> itr = list.GetIterator();
// loop through the list while the iterator is valid.
for( itr.Start(); itr.Valid(); itr.Forth() )
{
cout << itr.Item() << ", ";
}
// reset the iterator to the beginning again.
itr.Start();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -