accountlist.h
资源名称:c.rar [点击查看]
上传用户:puke2000
上传日期:2022-07-25
资源大小:912k
文件大小:1k
源码类别:
C#编程
开发平台:
Visual C++
- //=====================================
- // accountlist.h
- //=====================================
- #ifndef ACCOUNTLIST
- #define ACCOUNTLIST
- #include"account.h"
- //-------------------------------------
- class Node{
- public:
- Account& acnt;
- Node *next, *prev;
- Node(Account& a):acnt(a),next(0),prev(0){}
- bool operator==(const Node& n)const{ return acnt==n.acnt; }
- };//-----------------------------------
- class AccountList{
- int size;
- Node *first;
- public:
- AccountList():first(0),size(0){}
- Node* getFirst()const{ return first; }
- int getSize()const{ return size; }
- void add(Account& a);
- void remove(string acntNo);
- Account* find(string acntNo)const;
- bool isEmpty()const{ return !size; }
- void display()const;
- ~AccountList();
- };//-----------------------------------
- #endif // HEADER_ACCOUNTLIST