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

📄 stock2.h

📁 我学习C++ Primer Plus过程中写下的课后作业的编程代码
💻 H
字号:
// stock2.h -- augmented version
#ifndef STOCK_H_
#define STOCK_H_

class Stock
{
private:
	char	*company;
	int		shares;
	double	share_val;
	double	total_val;
	void set_tot(){ total_val = shares * share_val; }
public:
	Stock();
	Stock( const char * co, int n = 0, double pr = 0.0 );
	Stock( const Stock & s);
	Stock & operator = (const Stock & s);
	~Stock();
	void buy (int num, double price);
	void sell (int num, double price);
	void update (double price);
	const Stock & topval (const Stock & s)const;
	friend std::ostream & operator<< (std::ostream & os, const Stock & s);
};

#endif

⌨️ 快捷键说明

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