code/languages/cpp/delete_vs_free/README.md
The differences between delete,delete[] and free are as follows:
We cannot allocate an object with malloc() and free it using delete or allocate with new and delete with free() or use realloc() on an array allocated by new.The C++ operators new and delete guarantee proper construction and destruction; where constructors or destructors need to be invoked, they are. The C-style functions malloc(), calloc(), free(), and realloc() don’t ensure that. Furthermore, there is no guarantee that the mechanism used by new and delete to acquire and release raw memory is compatible with malloc() and free()
Link to the article: https://iq.opengenus.org/delete-vs-free-in-cpp/