Freeing allocated memory: realloc() vs. free()

前端 未结 7 1148
醉梦人生
醉梦人生 2020-12-10 04:05

so I have a piece of memory allocated with malloc() and changed later with realloc().

At some point in my code I want to empty it, by this

相关标签:
7条回答
  • 2020-12-10 04:56

    realloc() is used to increase or decrease the memory and not to free the memory.

    Check this, and use free() to release the memory (link).

    0 讨论(0)
提交回复
热议问题