【发布时间】:2020-07-16 18:12:58
【问题描述】:
当malloc 将NULL 值返回给指针时会发生什么?
当这个 if 语句被执行时
if (ptr == NULL) {
printf("Memory not allocated.\n");
exit(0);
}
我们退出了该计划。那么之后是什么让malloc 为相同的代码找到内存?
【问题讨论】:
标签: c memory-management dynamic-memory-allocation null-pointer