可能重复: C编程:free如何知道要释放多少?
嗨,
当我有以下代码:
void *ptr = malloc(100); // alloc 100 bytes // do sth free(ptr);
free()函数如何知道必须释放多少空间?
谢谢!
-
好的,我发现其他问题也一样,请关闭 - 对不起
c malloc free memory-management
c ×1
free ×1
malloc ×1
memory-management ×1