07-24-2023, 06:59 AM
In [this question][1], someone suggested in a [comment][2] 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?
[1]:
int *sieve = malloc(sizeof(*sieve) * length);
rather than:
int *sieve = (int *) malloc(sizeof(*sieve) * length);
Why would this be the case?
[1]:
[To see links please register here]
[2]:[To see links please register here]