Dear all,
I have two structures like this:
Code:
struct Matrix
{
int r;
int c;
double * E;
};
struct Model
{
int n;
int p;
struct Matrix * pMx;
};
And a function which works on a struct matrix; it's prototype is:
Code:
double MxGetElement(struct Matrix * p, int iR, int iC)
This function works well if given a pointer to a Matrix structure.
I would like to call it through a "Model" pointer, let's call it "pModel".
I tried
Code:
x=MxGetElement((struct Matrix *) pModel->pMx, iR, iC);
x=MxGetElement(&(pModel->pMx), iR, iC);
etc etc and cannot make it work. Probably simple for you guys. I hope you can help me.
Many thanks,
D.