|
|
|
|
|
by EpicEng
3038 days ago
|
|
Why would that be? You don't cast the result of malloc in C. It's wholly unnecessary, adds clutter to the code, and potentially hides an error if you forgot to include stdlib.h. So why would that be "the preferred way"? I've been writing C for some time and no one who knows C casts the return value of malloc. |
|
Also, the fact that they cast the result of malloc makes me think they were using a C++ compiler, which will complain that there's no cast.