Do I cast the result of malloc?
In this question, someone suggested in a comment that I should not cast the result of malloc. i.e., I should do this: int *sieve = malloc(sizeof(*sieve) * length); rather than: int *sieve = (int *) malloc(sizeof(*sieve) * length); Why would this be the case? 2 29 TL;DR int *sieve = (int *) malloc(sizeof(int) * length); … Read more