字符串数组 Debug 系统回收空间引起程序崩溃
demo
void testfunc(int iNum) { char sztest[3]; memset(sztest, 0, 3); sprintf(sztest, "%03d", iNum); return; }
控制台程序程序,调试时,当执行到函数结束时,程序会崩溃(不中断,可以继续执行),原因待定。栈(stack)”和“堆(heap),字符数组属于临时变量,声明时会在站上开辟空间。
Stack around the variable 'sztest' was corrupted

浙公网安备 33010602011771号