C++ Delete Confusion
In the sample code
int* p_sample = new int;
*p_sample = 10;
the pointer p_sample is pointing at memory 5400
Is it deleting/free the value 10? or the memory 5400 and setting it to nullptr?
Delete just releases the memory back to the operating system. It doesn't change the memory or set the pointer to the nullptr.
Topic archived. No new replies allowed.