10-16-2007 05:43 AM
10-16-2007 06:13 AM
10-16-2007 06:44 AM
Hi and thank you.
that's it.
now I make it this way:
double * spectrum=(double*)malloc(mono.angles*mono.datapoints*sizeof(double));
mono.spectrum = &spectrum;
10-19-2007 04:57 AM
10-19-2007 06:21 AM
In situations like this it can often help to use a typedef to clarify what is intended, for example by defining a 1D array type. If you then have a pointer to an object of this type, it will naturally beome a 2D array and the compiler should be happy. One drawback (of the C89 CVI compiler) may be that the size of such a typedef'ed array has to be fixed at compile time, so this could compromise your overall approach of dynamic allocation/sizing. (I don't have access to my CVI compiler at the moment so I can't test this.)
JR