Alright, I will try that.
One more problem, well, actually three. The unresolved externals. I have no idea what to do or even look for, I've been up and down the code, whenever I declare my accesor methods as constant, I get these unresolved externals:
Here are my two files, and the errors are:
Matrix.obj : error LNK2001: unresolved external symbol "public: double __thiscall CMatrix::GetSingle(unsigned short,unsigned short)" (?GetSingle@CMatrix@@QAENGG@Z)
Matrix.obj : error LNK2001: unresolved external symbol "public: short __thiscall CMatrix::GetColumns(void)" (?GetColumns@CMatrix@@QAEFXZ)
Matrix.obj : error LNK2001: unresolved external symbol "public: short __thiscall CMatrix::GetRows(void)" (?GetRows@CMatrix@@QAEFXZ)
I've stripped it down to just the offending functions.
Code:
[CMatrix.cpp]
#include "stdafx.h"
#include "CMatrix.h"
#include <cstdarg>
...
double CMatrix::GetSingle(unsigned short int iRowNum, unsigned short int iColumnNum) const
{
if (m_pdMatrixData == NULL) return NULL;
if (iRowNum > m_iDimension[0]) return NULL;
if (iRowNum > m_iDimension[1]) return NULL;
return m_pdMatrixData[iRowNum][iColumnNum];
}
short CMatrix::GetRows() const
{
if (m_pdMatrixData == NULL) return 0;
return m_iDimension[0];
}
short CMatrix::GetColumns() const
{
if (m_pdMatrixData == NULL) return 0;
return m_iDimension[1];
}
void CMatrix::GetDimensions(short int &iRow, short int &iColumn) const
{
if (m_pdMatrixData == NULL)
{
iRow = 0;
iColumn = 0;
return;
}
iRow = m_iDimension[0];
iColumn = m_iDimension[1];
}
double **CMatrix::GetMatrix() const
{
if (m_pdMatrixData == NULL) return NULL;
return m_pdMatrixData;
}
...
Code:
[CMatrix.h]
#ifndef MATRIX_H
#define MATRIX_H
class CMatrix {
public:
...
double **GetMatrix() const;
double GetSingle(unsigned short int iRowNum, unsigned short int iColumnNum) const;
void GetDimensions(short int &iRow, short int &iColumn) const;
short GetColumns() const;
short GetRows() const;
...
private:
...
double **m_pdMatrixData;
double **m_pdTempMatrix;
};
#endif;