Need some clarification regarding casting in C

后端 未结 13 2166
野趣味
野趣味 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:51

    My simple guideline - if it needs a cast, it's probably wrong. If you don't need a cast, don't use them.

提交回复
热议问题