Я решил все сам, ток не могу понять как оно работает:
Код:

//MAIN.CPP
//Перегрузка операций
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
using std::ostream;
using std::istream;
#include <iomanip>
using std::setw;
//Определение класса Matrix
class Matrix
{
friend ostream &operator<< (ostream &, const Matrix &);
public:
int *operator[](int);
Matrix(int, int);
~Matrix();
private:
int ROW;
int COLUMN;
int **matrixPtr;
int *linePtr;
};
//----------------------------------------------------------------
int *Matrix::operator[] (int number)
{
return matrixPtr[number];
}
//----------------------------------------------------------------
Matrix::~Matrix()
{
for(int i = 0; i < ROW; i++)
delete [] matrixPtr[i];
delete [] matrixPtr;
}
//----------------------------------------------------------------
ostream &operator<< (ostream &out, const Matrix &M)
{
for(int i= 0; i <M.ROW; i++)
{
for(int j = 0; j < M.COLUMN; j++)
out << setw(4) << *(M.matrixPtr[i]+j) << ' ';
out << endl;
}
return out;
}
//---------------------------------------------------------------
Matrix::Matrix(int row, int column)
{
ROW = row;
COLUMN = column;
matrixPtr = new int*[ROW];
for(int i = 0; i < ROW; i++)
{
matrixPtr[i] = new int[COLUMN];
for(int j = 0; j < COLUMN; j++)
*(matrixPtr[i] + j) = j*i;
}
}
int main()
{
int m[2][3];
setlocale(LC_ALL, ".1251");
cout << "Введите размер матрицы(строк -> столбцов)" << endl;
int row, column;
cin >> row >> column;
Matrix matrix(row, column);
cout << matrix << endl;
cout << "Введите индекс ячейки(стока -> столбец)" << endl;
cin >> row >> column;
cout << "matrix[" << row << "][" << column << "]= " << matrix[row][column] << endl;
system("pause");
return 0;
}