when trying to call the NumCols and NumRows functions I get these error:PHP Code:#define matrix Matrix
template <class Object>
class matrix
{
public:
matrix( int rows, int cols )
{
vOuter.resize(rows);
for(int i = 0; i < rows; i++)
vOuter[i].resize(cols);
NumOfRows = rows;
NumOfCols = cols;
}
matrix( const matrix &rhs)
{
vOuter(rhs.vOuter)
}
const vOuter<object> &operator[] (int row) const
{
return vOuter[row];
}
vector<Object> &operator[] (int row)
{
return vOuter[row];
}
int NumRows()
{
return NumOfRows;
}
int NumCols()
{
return NumOfCols;
}
private:
vector< vector<Object> > vOuter;
int NumOfRows;
int NumOfCols;
};
MatrixTest.cpp(15) : error C2039: 'NumRows' : is not a member of 'Matrix<int>'
MatrixTest.cpp(16) : error C2039: 'NumCols' : is not a member of 'Matrix<int>'
I can't seem to figure out what I screwed up...




Reply With Quote