I am new to c++ but from what I understood you need to delete objects from memory when you are done with them.
Having a class called myClass. If I create a new instance and call some of its functionalities. Like so:
MyClass p;
p.funcCall(12);
p.anOtherFuncCall(4);
How am I supposed to free the memory occupied by p again? I read this Microsoft article. But if I change it to:
MyClass* p = new MyClass
... call fucntions
delete p;
I can no longer call my functions like p.funcCall(12)
.
If I understood memory management in c++ incorrectly I would love to hear that as well.