polynomialtype.h

来自「这是学习《Data Structures Using C++》」· C头文件 代码 · 共 41 行

H
41
字号

#ifndef H_polynomial
#define	H_polynomial

#include <iostream>
#include "arrayListType.h"

using namespace std;

class polynomialType: public arrayListType<double>
{
	friend ostream& operator<<(ostream&, const polynomialType&);
		//overload stream insertion operator
	friend istream& operator>>(istream&, polynomialType&);
		//overload stream extraction operator
public:
	polynomialType operator+(const polynomialType&);
		//overload the operator +
	polynomialType operator-(const polynomialType&);
		//overload the operator -
	polynomialType operator*(const polynomialType&);
		//overload the operator *

	double operator() (double x);
		//overload the operator () to evaluate the
		//polynomial at a given point
		//Postcondition: The value of the plynomial at x
		//		         is calculated and returned
	
	polynomialType(int size = 100);
		//constructor
	
	int min(int x, int y);
		//Function to return the smaller of x and y
	int max(int x, int y);
		//Function to return the larger of x and y
};

#endif

⌨️ 快捷键说明

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