@vladpenziy13

Как переделать дружественную функцию из обычно?

#define TLINE_H
using namespace std;
class Lamana
{
protected:
	int len;
	int* points;
	char letter;
	static int ordNum;


public:
	Lamana();
	Lamana(int* fill, int l);
	Lamana(const Lamana&);
	~Lamana();
	
	void input();
	void output();
    
	Lamana& operator=(const Lamana&);
<b>	 Lamana operator+(const Lamana&);</b>
	
	int isClosed()const;
	int inPlane();
	void proections();
	
};

Lamana Lamana::operator+(const Lamana& line) {
	Lamana temp;
	cout << "Operator + is on progress" << endl;
	cout << "Line " << line.letter << " is added to " << letter << endl;
	temp.len = this->len + line.len;
	cout << " this.len "<< this->len << endl;
	cout << " line.len "<< line.len << endl;
	temp.points = new int[temp.len * 3];
	int i{ 0 };
	while (i < this->len * 3) {
		temp.points[i] = this->points[i];
		i++;
	}
	int j{ 0 };
	while (i < temp.len * 3)
	{
		temp.points[i] = line.points[j];
		i++; j++;
	}
	return temp;
}
  • Вопрос задан
  • 59 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы