In this question, someone suggested in a comment that I should not cast the results of malloc
, i.e:
int *sieve = malloc(sizeof(int)*length);
Rather than:
int *sieve = (int *)malloc(sizeof(int)*length);
Why would this be the case?
EDIT
Marked as duplicate cause I did not research enough.