且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

这是C语言中的双重免费吗?

更新时间:2023-11-12 19:19:34

是.该库不在乎您在源代码中给变量起了什么名字(到代码执行时已经很久了).重要的是值,在这种情况下,传递给free()的值将是相同的.

Yes. The library doesn't care what name you gave a varaible in your source code (it's long gone by the time the code is executed). All that matters is the value, and in this case the values passed to free() would be the same.