Doesn't malloc(); function return a void pointer? Then why in the malloc(); module in C, the type casting is not used? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Doesn't malloc(); function return a void pointer? Then why in the malloc(); module in C, the type casting is not used?

19th Apr 2020, 8:09 AM
Manthan Gohel
Manthan Gohel - avatar
1 Answer
+ 3
I'm more concerned with the absence of `free` usage example in examples involving dynamic memory allocation. Also the pointer validity verification before use is not included in examples. But maybe it's just to keep the examples short, and easier to digest.
19th Apr 2020, 8:53 AM
Ipang