this is the code i have written so far....its in c++....i need ur help....i can't find errors...:(
class Matrix
{
private:
int rows;
int cols;
float *pData;
public:
int getrows(){return rows;}
int getcols(){return cols;}
void setrows(){rows=r;}
void setcols(){cols=c;}
private:
void doCreate();
void doAdd(Matrix m);
void doSub(Matrix m);
void doTranspose();
void doDelet();
void doDisplay();
void doInsert();
public:
void Create(){doCreate();}
void Add(Matrix m){doAdd(Matrix m);}
void Sub(Matrix m){doSub(Matrix m);}
void Transpose(){doTranspose();}
void Delet(){doDelet();}
void Display(){doDisplay();}
void Insert(){doInsert();}
};
void Matrix:: DoCreate() //////create function///////
{
pData = new float *[rows];
for(int i=0;i<rows;i++)
pData=new float[cols];
}
void main()
{
int x;
Matrix m;
m.setrows(3);
m.setcols(4);
m.Create();
m.Insert();
m.Display();
m.Transpose();
}
i dnno how to insert in without using an array...:(