E
entitledX
Hi, I'm trying to use the HDF library to read a few HDF files that I
need to process. The data in each file varies in rows, but the
columns remain constant. Because of that, I had dynamically allocated
a set of
pointer to pointers as my multi-dimensional arrays. Here is my code (i
have omitted checking calloc's return value to make this shorter):
int **filter;
filter = calloc( ylength, sizeof(int*) );
for( i = 0 ; i < ylength ; i++ )
filter = calloc( xlength, sizeof(int*) );
The problem is that the function I have to use SDreaddata works fine if
I declare filter as an actual multi-dimensional array: int
filter[ylength][xlength]; However, I keep getting segmentation fault
errors.
SDreaddata is declared as:
intn SDreaddata
(int32 sdsid, int32 *start, int32 *stride, int32 *end, void *
data);
data is the parameter I am trying to pass filter to.
Is there a way of passing filter into this function, somehow? Thanks in
advance.
need to process. The data in each file varies in rows, but the
columns remain constant. Because of that, I had dynamically allocated
a set of
pointer to pointers as my multi-dimensional arrays. Here is my code (i
have omitted checking calloc's return value to make this shorter):
int **filter;
filter = calloc( ylength, sizeof(int*) );
for( i = 0 ; i < ylength ; i++ )
filter = calloc( xlength, sizeof(int*) );
The problem is that the function I have to use SDreaddata works fine if
I declare filter as an actual multi-dimensional array: int
filter[ylength][xlength]; However, I keep getting segmentation fault
errors.
SDreaddata is declared as:
intn SDreaddata
(int32 sdsid, int32 *start, int32 *stride, int32 *end, void *
data);
data is the parameter I am trying to pass filter to.
Is there a way of passing filter into this function, somehow? Thanks in
advance.