Needless pointer-casts in C

前端 未结 12 731
刺人心
刺人心 2020-12-09 10:05

I got a comment to my answer on this thread:

Malloc inside a function call appears to be getting freed on return?

In short I had code like this:



        
12条回答
  •  南笙
    南笙 (楼主)
    2020-12-09 10:54

    On the other hand, if you ever need to port the code to C++, it is much better to use the 'new' operator.

提交回复
热议问题