此分配是否已在堆栈上完成,我是否需要在此cLastDateToRun代码上进行删除?其内部功能。
wchar_t cLastDateToRun[9] = { 0 };
wcsncpy_s(cLastDateToRun, SerialNumber, 8);
cLastDateToRun[8] = L'\0';
int LastDateToRun = _wtoi(cLastDateToRun);
delete[] cLastDateToRun;
由于您的阵列在堆栈上,因此不需要free()
它。仅使用malloc()
calloc()
或分配的内存是由您分配的realloc()
。在堆栈上显式释放内存将导致未定义的行为。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句