Необходимо перегрузить оператор индексации [ ] , я сделал как мог, но преподу не понравилось, сказал перегрузить с помощью вспомогательного класса. Я не знаю как, помогите, пожалуйста.
Вот мой код:
Код:
#pragma once
#include <iostream>
using namespace std;
class matrix
{
private:
double *a;
int n, m;
public:
matrix (int = 0,int = 0, double* = NULL);
matrix (const matrix&);
~ matrix ();
bool umnojenie (const matrix& ) const;
bool summa (const matrix& ) const;
const double* operator[] (int i) const;
double* operator[] (int i);
matrix& operator = (const matrix&);
matrix& operator +=(const matrix&);
matrix& operator -=(const matrix&);
matrix& operator *=(const matrix&);
matrix& operator *=(const double);
friend matrix operator * (const matrix&, const matrix&);
friend matrix operator * (const matrix&, double);
friend matrix operator * (double , const matrix&);
friend matrix operator + (const matrix&, const matrix&);
friend matrix operator - (const matrix&, const matrix&);
int get_Row () const;
int get_Col () const;
friend ostream& operator << (ostream&, const matrix &);
};