Difference Between Malloc and New in C++
new and delete
- the way it allocate and release memory
- the memory is allocate from
Free Store
- will return a fully typed pointer
- if failed will not return NULL
- the compiler will calculate the size
- reallocate is not handled intuitively, using copy constructor
- whether called malloc and delete can be user defined
- can add a new memory allocator to deal with low memory
- new and delete can be overwrite legally
- use constructor/destructor to initial/destory object
- the memory is allocate from