help for vc++ 6.0

> a[n][n] and b[n][m] are two dimensional arrays.
> These are passed to the procedure
void gaussj(float **a, int n, float **b, int m)

What will be arguments in the calling program (main program)?

I have used following syntax:
gaussj(a, n, b, m);

On compiling in VC++ (6) I get the following error:
error C2664: 'gaussj' : cannot convert parameter
> 1 from 'float [3][3]' to 'float ** '
> Types pointed to are unrelated; conversion requires
> reinterpret_cast, C-style cast or function-style cast
> Error executing cl.exe.

Please help.
 
Sure, it isn't a Borland code?!? Many of the (sub)routines (Numerical recipes in C,...etc) don't work or are much too complicated for the thing they do.... There is a much simpler way of inverting a square matrix of unlimited size.... I'm not talking about Single Value Decomp. Techniques,...
 
C
One of the thing you can do, is to use cast redefinition, so your function need float ** but you, you have a data a[3][3] so don't call it by a but by (float**)a. ex : fn(float **var) { } don't call in main by fn(a) but by fn((float**)a) See you !
 
Dear Sir,

Please send some more details on this document. i want to know about parallel processing interface communication by process. i already referred M.F.C Class library in microsoft online help .
Regrads
Murali.

 
J

Jitender Jit Singh Cheema

You should decalre a and b as pointer to pointer.For example.

float **a;
float **b;

the allocate memory using new or malloc;

load your a and b two dimensional array with the values. e.g. a[1][3]=5.6f; b[4][5]=5.53f;
then you can call the


gaussj(a,b,n);

void gaussj(float **a, int n, float **b, int m)
{

// guassj code here....
}


> > a[n][n] and b[n][m] are two dimensional arrays.
> These are passed to the procedure
void gaussj(float **a, int n, float **b, int m)

What will be arguments in the calling program (main program)?

I have used following syntax:
gaussj(a, n, b, m);

On compiling in VC++ (6) I get the following error:
error C2664: 'gaussj' : cannot convert parameter
> 1 from 'float [3][3]' to 'float ** '
> Types pointed to are unrelated; conversion requires
> reinterpret_cast, C-style cast or function-style cast
> Error executing cl.exe.

Please help.
 
Thread starter Similar threads Forum Replies Date
J Modbus 2
J Motion Control 1
J Modbus 0
X Open Platform Communications (OPC) 2
A Languages 1
Top