citer.h
来自「data structures, algorithms and Applicat」· C头文件 代码 · 共 25 行
H
25 行
// file citer.h
#ifndef ChainIterator_
#define ChainIterator_
#include "chain.h"
template<class T>
class ChainIterator {
public:
T* Initialize(const Chain<T>& c)
{location = c.first;
if (location) return &location->data;
return 0;}
T* Next()
{if (!location) return 0;
location = location->link;
if (location) return &location->data;
return 0;}
private:
ChainNode<T> *location;
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?