当我在c ++中多次初始化变量时,内存位置会发生什么变化?例如:
LPWSTR sampleString = new whcar_t[10];
//some operations here
sampleString = new wchar_t[2];
//some operations here
sampleString = new wchar_t[25];
//some operations here
Run Code Online (Sandbox Code Playgroud)
如果我通过使用删除内存delete [] sampleString;将清除所有相关的内存位置?