citer1.h
来自「data struct algorithm and application in」· C头文件 代码 · 共 30 行
H
30 行
// null destructor has been added because DeactivatePos
// of lnbase crashes when deleting an array of chain
// iterators; happens only with Visual C++
#ifndef ChainIterator_
#define ChainIterator_
#include "chain.h"
template<class T>
class ChainIterator {
public:
~ChainIterator() {}
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 + -
显示快捷键?