Malloc calls HeapAlloc HeapFree or whatever system calls are platform dependant for memory management by default. Because Malloc is standard c library not platform dependant so it's implementation varies depending on which platform/architecture you're running on. Only advantage to usi...
It didnt create another object it simply called the destructor by default when main exited. Memory is freed automatically ( reference to the memory not the memory per se ) when process exited and destructor got called thats why u see creating cat. Try using cout << destroying cat << endl as destr...
@AES256bit
Malloc calls HeapAlloc HeapFree or whatever system calls are platform dependant for memory management by default. Because Malloc is standard c library not platform dependant so it's implementation varies depending on which platform/architecture you're running on. Only advantage to usi...