0
Error Memory leak
Why does my code has an memory leak on the copy constructor and the passed in constructor. https://code.sololearn.com/c7H3CTZ2mIKX/?ref=app
3 Answers
0
Since program does nothing, it has no leak. If you attempt to delete storage that was not allocate by new using the first constructor, you will get an error on the delete.
0
John Wells i tried to check of the array is equal to null ptr then delete on my destructor but still have a memory leak. My code works just fine but its telling me that on the copy and passed in constructor had a leak for some reason. If i delete the orginal one after copying it, it wouldnt copy anything?
0
Can you show that code so I can duplicate it? At the moment, it does nothing.