When you allocate memory to char* p
, it has memory location at heap section it points to.
However, once the following line is executed, would it point to new memory location at Data section and assign pointer to it?
char* p = "newstring";
If so, there is no way to find the allocated memory and free it afterward?