Hello everyone, I have been banging my head trying to understand the following. First, let me note that the correct way of doing this would be with smart pointers, but my curiosity has really gotten the better of me!
Here is my code : https://paste.ofcode.org/guvXn7iz5tWtZ6mRHEdR2S
I am trying to understand why these objects are not calling the destructors: (maybe the keyword new and delete are always needed in these cases?) I couldn't find any examples without these keywords or smart pointers. I know, I know, use smart pointers instead.
A testObject1
AtestObject2
B* testObA;
B testObb;
A test_1;
A * test_2;
B * testOb1;
B testOb2;
//THIS ONE DID CALL "destructor," why?
A testObjA;
A * testObjB;
Thank you so much,
Josheir