malloc() in C not working as expected

前端 未结 7 710
别那么骄傲
别那么骄傲 2021-01-25 04:52

I\'m new to C. Sorry if this has already been answered, I could\'n find a straight answer, so here we go..

I\'m trying to understand how malloc() works in C. I have this

相关标签:
7条回答
  • 2021-01-25 05:57

    Simply this is one of the case of undefined behavior. You are unlucky that you are getting the expected result.

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