Want to improve this question? Add details and clarify the problem by editing this post.
Closed 10 years ago.
这取决于内存的分配方式。
如果使用了malloc(),则将分配的内存的地址传递给free()。如果它来自第三方库,请参阅该库的文档。如果结构实际上是局部或全局变量,则根本不用担心清理它。
malloc()
free()
That depends on how the memory was allocated.
If malloc() was used, pass the address of the allocated memory to free(). If it came from a third-party library, see that library's documentation. If the struct is actually a local or global variable, don't worry about cleaning it up at all.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(1)
这取决于内存的分配方式。
如果使用了
malloc()
,则将分配的内存的地址传递给free()
。如果它来自第三方库,请参阅该库的文档。如果结构实际上是局部或全局变量,则根本不用担心清理它。That depends on how the memory was allocated.
If
malloc()
was used, pass the address of the allocated memory tofree()
. If it came from a third-party library, see that library's documentation. If the struct is actually a local or global variable, don't worry about cleaning it up at all.