методом научного тыка:
Код:

template<class MATRIXTYPE>
ostream &operator<< (ostream &out, const MATRIX<MATRIXTYPE> &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
#include <iostream>
#include <iomanip>
using std::cout;
using std::cin;
using std::endl;
using std::setw;
using std::ostream;
template<class MATRIXTYPE>
class MATRIX
{
friend ostream &operator<< (ostream &, const MATRIX &);
public:
MATRIX(int, int);
~MATRIX();
void T(void);
private:
int COLUMN;
int ROW;
MATRIXTYPE **matrixPtr;
};
template<class MATRIXTYPE>
MATRIX<MATRIXTYPE>::MATRIX(int row, int column)
{
if(row <= 0)
row = 1;
if(column <= 0)
column = 1;
this->ROW = row;
this->COLUMN = column;
this->matrixPtr = new MATRIXTYPE*[this->ROW];
for(int i = 0; i < this->ROW; i++)
{
this->matrixPtr[i] = new MATRIXTYPE[this->COLUMN];
for(int j = 0; j < this->COLUMN; j++)
*(this->matrixPtr[i] + j) = 0;
}
}
template<class MATRIXTYPE>
ostream &operator<< (ostream &out, const MATRIX<MATRIXTYPE> &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;
}
int main()
{
setlocale(LC_ALL,".1251");
int _row, _column;
cout << "ВВЕДИТЕ РАЗМЕРЫ МАТРИЦЫ" << endl;
cin >> _row, _column;
MATRIX<int> matrix(_row, _column);
cout << matrix;
system("pause");
return 0;
}
Ошибка 2 error LNK2019: ссылка на неразрешенный внешний символ "public: __thiscall MATRIX<int>::~MATRIX<int>(void)" (??1?$MATRIX@H@@QAE@XZ) в функции _main matrix.obj
Ошибка 3 error LNK2019: ссылка на неразрешенный внешний символ "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class MATRIX<int> const &)" (??6@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AAV01@ABV?$MATRIX@H@@@Z) в функции _main matrix.obj
Ошибка 4 fatal error LNK1120: 2 неразрешенных внешних элементов C:\$p\mvs\matrix\транспонирование\Debug\транспонирование.exe