Visual C + + Runtime features--non-scalding is the Tun
Freshman just learn C language, the second time on the machine class, when I found that I follow the book copy of the program in the black box outside the run jumped out of a row of "Hot Hot Hot Hot hot", then shocked. Can you imagine a child from a small town who had never been exposed to a computer or code before college? I really thought it was a warning that the computer was overheating, so I bent down and pulled the plug.
——————————————————————————————
VC Runtime Debug version will initialize the stack into 0xcc,unicode 0XCCCC (double byte) is the Chinese hot. If you open a char[], and then the last character is set to 0x00, and then go to the printf character, then the entire stack from this local character array start output to the console, it becomes a "Hot Hot Hot Hot hot."
Why did you initialize stack to 0XCC instead of 0x00? is because 0XCC in the Intel x86 chip instruction set represents int 3, that is, debug interrupt, the instruction will automatically stop the program in a single-step debugging state, and then to find the system registered debugger, if the debugger is not found, then the program will be terminated. This was started in order to debug the stack buffer overflow error. If an overflow occurs, and the code tries to execute the instruction in the buffer, it goes into a single-step debug state.
This is debug version, so what about release verion? The release will initialize the stack to 0xCD, this is IMM8, is immediately interrupt exit meaning. This is because it runs on the user's machine, does not have a debugger, and does not want users to debug your program. 0XCDCD is the word "tun" in Chinese. You will see some of the very bad writing programs often appear "Tun Tun Tun Tun Tun Tun". It's quite a tun, F.
In today's chip DEP, operating system NX locks the era of double insurance, this initialization is no longer necessary, the iron is still a purely historical reason.
So in our computer also compared to the old age, said people character is not good, it is called non-rape is stolen. Say that the program is bad, it is called non-hot tun.
Reference:
http://www.ccthere.com/article/4019197
Visual C + + Runtime features--non-scalding is the Tun