01-16-2007 09:45 AM
01-16-2007 10:51 AM
01-16-2007 04:55 PM
Yes, I think that will help. Thank You very much Alex!
Elwood
01-17-2007 09:01 AM
Elwood,
Based on your stated lack of programming experience, I'll just throw in a couple of tips. To create an array of the correct size, use the calloc() function, which allocates and initalizes to zero an array of the required size. When you are done, be sure to use free() to free the memory. A few key lines might look like this:
double *hh;
// Create dynamic array
hh = calloc (numrows*numcols, sizeof(double));
if (hh == NULL) {
MessagePopup("Error", "calloc error");
return;
}
//Copy data from a larger static array H
offset=0;
for (ii=0; ii< numrows; ii++) {
for (jj=0; jj < numcols; jj++) {
*(hh+ offset) = H[ii][jj];
offset++;
}
}
// Perform library operation here
// Free the memory when done
free (hh);