Why does initializing a string in a function doesn't work like int while debugging

瘦欲@ 提交于 2019-12-06 15:47:35

As @user3386109 pointed out , The issue is to prevent overflow the default security check in visual studio is enabled , and it provides extra space in order to prevent overflows , so turning it off , made the compiler allocate only 12 bytes :D

To turn this security measure ( Buffer Security Checks GS) off Project settings -> C/C++ -> Code generation -> security check = disable GS

Some post related to GS

http://preshing.com/20110807/the-cost-of-buffer-security-checks-in-visual-c/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!