aobj i allocated on the heap so it cannot be deleted(desctructed). It will be available as long as it's inside the scope. Once it's out of scope is overridden automatically so there is no point to use if(aobj) it will live inside the scope.
int fun() {
A aobj; // this object cannot be deleted because there is no new operator
// and it will live until the function will return(or die)
if(aobj) { // there is no point to test it because will always be true(except OS crash)
}
return 0;
}
If you need objects outside the scope you have to create them with new and assign null to pointers(c++11) when delete them so you will know when a object no longer exists by it's null pointer.