You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
free(ptr); //if we don't free the memory here then the memory allocated from the previous function call will stay there as garbage value and it will stay in the memory for no reason. this condition is called memory leak. java and python has garbage collectors to prevent this but c++ doesn't has this concept. so we have to be careful to deallocate the memory after it has been used.