image_cover_t* new_cover; /* the new cover *
/* Allocate the new image cover. */
if (NULL == (new_cover = malloc (sizeof (*new_cover)))) {...
and
int *iptr;
iptr = (int *)malloc(10 * sizeof(int));
if (iptr == NULL){...
Namely, the malloc line... I don't understand why one uses sizeof(address-of-variable) and another uses sizeof(variable-type)? Help?
(Yeah, this is probably absurdly basic, but.. I dunno. This is what I get for learning Java before C, and not really fully understanding memory)
Like.. would, "if (NULL == (new_cover = malloc (sizeof (image_cover_t)))) {..." work too...?