void readruku(char *pfile);//读出文件中的入库信息
void filetuihuo(char *pfile);//将退货信息写入文件
void readtuihuo(char *pfile);//读出文件中的退货信息
void filexiaoshou(char *pfile);//将销售信息写入文件
void readxiaoshou(char *pfile);//读出文件中的销售信息
void selectfile(char *pfile,int i);//实现商品入库、销售、退货
void zhuan(char *pfile2,char *pfile3);//将临时文件的内容覆盖到原有文
件,并清空临时文件
private:
long mai;
long m_lTime;
double jin;
char reason[30];
};
//**************商品类成员函数实现************************
void CGoods::output1()
{
cout<<"商品编号:"<<m_lNum<<endl;
cout<<"商品名:"<<GetName()<<endl;
cout<<"价格:"<<GetPrice()<<endl;
cout<<"库存:"<<GetKucun()<<endl;
}
void CGoods::input1()
{
m_lNum=getNum("d:\\test2.txt");m_lNum++;
SetName();
SetPrice();
SetKucun();
}
int CGoods::getNum(char *pfile)
{
int temp=0;
ifstream ifile(pfile);
if(!ifile)
{
cout<<"超市无商品"<<endl;
}
else
{
评论11
最新资源