If I use new
operator to create a object like this in a method:
void functionA(){
ClassA *a = new ClassA();
}
Do I need to use the following code to release it?
delete a;
Can c++ auto release the ClassA object's memory? when it run out of the functionA scope.
If I write codes like this
void functionA(){
ClassA a = ClassA();
}
Does a automatically be released?