⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 other.cpp

📁 课程设计做的个人股票管理系统
💻 CPP
字号:
#include <iostream.h>
#include <fstream.h>
#include <iomanip.h>
#include <string.h>
#include <conio.h>
#include <stdlib.h>
#include <time.h>
#include "Stock.h"
#include "GuestStock.h"
#include "Guest.h"



//把买卖后股票信息实时写入文件中		//注:time has been considered yet
void Update(Stock &stkObj)
{
	ofstream fout;
	//fout.open(stkObj.GetStkName(), ios::out|ios::app);
	fout.open(stkObj.GetStkName(), ios::out);				//这个也暂且改成覆盖
	//	fout.write((const unsigned char *)&time, sizeof(time));
	fout.write((const unsigned char *)&stkObj, sizeof(Stock));
	//fout.put('\n');
	fout.close();
}

//把买卖后用户信息实时写入文件中		//注:time has been considered yet
void Update(Guest &guestObj)
{
	ofstream fout;
	//fout.open(guestObj.GetGuestName(), ios::out|ios::app);		//用于追加历史信息
	fout.open(guestObj.GetGuestName(), ios::out);					//用于覆盖文件,是解决文件过大时无此用户的权宜之计
	//	fout.write((const unsigned char *)&time, sizeof(time));
	fout.write((const unsigned char *)&guestObj, sizeof(Guest));
	//fout.put('\n');
	fout.close();
}



void About()
{
	cout<<"created by chen shujie"<<endl
		<<"press any key to return to main menu"<<endl;
}

void Error()
{
	cout<<"您的输入有误,按任意键返回上一层菜单。"<<endl;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -