?? wateruser.cpp
字號:
// WaterUser.cpp: implementation of the WaterUser class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "atm.h"
#include "WaterUser.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
WaterUser *WaterUser::pFirstP=NULL; //鏈表為空
WaterUser::WaterUser(CString phno,double co)
{
waterno=phno;
cost=co;
if(pFirstP==NULL)
pFirstP=this; //空鏈表中建立一新帳戶
else
{
WaterUser *ps=pFirstP;
for (;ps->pNextP;ps=ps->pNextP);
ps->pNextP=this; //在最后插入本節(jié)點
}
pNextP=NULL;
}
WaterUser::~WaterUser()
{
}
ostream& operator <<(ostream & out ,WaterUser &phu)
{
out<<phu.Getwaterno()<<" "<<phu.Getcost()<<" "<<endl;
return out;
}
WaterUser* WaterUser::searchwateruser(CString waterno)
{
WaterUser *pc=pFirstP;
if(pc==NULL)
{
return NULL;
}
for (;pc;pc=pc->pNextP)
{
if (pc->Getwaterno()==waterno)
{
return pc;
}
}
return NULL;
}
bool WaterUser::storageP()
{
ofstream out("水費用戶.txt");
if(pFirstP==NULL)
return 1;
WaterUser *pc=pFirstP;
for (;pc;pc=pc->pNextP)
{
out << *pc ;
}
out.close();
return true;
}
/*
// Phoneuser.cpp: implementation of the CPhoneuser class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ATM.h"
#include "Gasuser.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
*/
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -