且构网

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

C-malloc分配过多的内存

更新时间:2023-02-09 15:12:26

malloc实际上实际上分配了正确的数量.

malloc is actually allocating exactly the right amount.

但是,您正在访问的内存超出了分配范围.

However, you're accessing memory beyond the allocation.

存在的东西是完全未定义的,真的可以是任何东西.

What exists there is completely undefined and could really be anything.

在您的情况下,它是一个垃圾"数字和四个零.

In your case, it was one "junk" number and four zeroes.