Need some clarification regarding casting in C

后端 未结 13 2145
野趣味
野趣味 2020-12-20 04:01

I was just reading about the bad practice of casting the return value of malloc. If I understood correctly, it is absolutely legal to leave the cast as it is do

13条回答
  •  伪装坚强ぢ
    2020-12-20 04:36

    You might find these two SO posts informative:

    Specifically, what’s dangerous about casting the result of malloc?

    Do Implict Function Declarations in C Actually Generate Object Code?

提交回复
热议问题