S
Steven
Hello,
I get the following message during compilation:
`dereferencing pointer to incomplete type'
It stems from the compare function I use with qsort() and I am not
quite sure how to fix it.
I have a struct like:
struct node {
time_t utc;
};
And the code that generates the error during compilation:
int cmputc(const void *x, const void *y) {
struct tnode * const *a = x;
struct tnode * const *b = y;
int retv = 0;
if((*a)->utc < (*b)->utc)
retv = -1;
else if((*a)->utc == (*b)->utc)
retv = 0;
else
retv = 1;
return retv;
}
Does anyone know what I am doing wrong ?
Thank you for your explanation.
Steven.
I get the following message during compilation:
`dereferencing pointer to incomplete type'
It stems from the compare function I use with qsort() and I am not
quite sure how to fix it.
I have a struct like:
struct node {
time_t utc;
};
And the code that generates the error during compilation:
int cmputc(const void *x, const void *y) {
struct tnode * const *a = x;
struct tnode * const *b = y;
int retv = 0;
if((*a)->utc < (*b)->utc)
retv = -1;
else if((*a)->utc == (*b)->utc)
retv = 0;
else
retv = 1;
return retv;
}
Does anyone know what I am doing wrong ?
Thank you for your explanation.
Steven.