这个类的抽象稀疏矩阵类申明的问题何在??
这是用C++表示的一个稀疏矩阵
template <class T> class SparseMatrix
{
private:
int Rows,Cols,Terms;
Trituple <T> smArray[MaxTerms];//用于存矩阵中非零元素的值
//此处有四处错误,分别为
//1.error C2143: syntax error : missing ';' before '<'
//2.error C2501: 'Trituple' : missing storage-class or type specifiers
//3.error C2059: syntax error : '<'
//4.error C2238: unexpected token(s) preceding ';
public:
SparseMatrix(int MaxRow, int MaxCol);
SparseMatrix <T> Transpose();
SparseMatrix <T> Add(SparseMatrix <T> b);
};
template <class T> class Trituple
{
friend class SparseMatrix <T>;
private:
int row,col;//the row and column of sparse matrix T value; //row col 分别表示矩阵的行和列,value 为该行列时的值
};
void main()
{}
到底错误在什么地方呢?运行环境为vc6.0
要怎么改正呢?