new and free
-
Hi! Is it possible to deallocate a memory that was allocated by new using free function? Otherwise what will happen if we deallocate using free function while the memory is allocated using new in C++?
-
Hi! Is it possible to deallocate a memory that was allocated by new using free function? Otherwise what will happen if we deallocate using free function while the memory is allocated using new in C++?
-
Thank you Sir :) .
-
Thank you Sir :) .
-
Hi! Is it possible to deallocate a memory that was allocated by new using free function? Otherwise what will happen if we deallocate using free function while the memory is allocated using new in C++?
One thing I would like to add here is that for a UDT,
free
deallocated memory, whereasdelete
first calls the destructor and then deallocates memory. Same thing for dynamic array allocation. Hear it from the man himself - Can I mix C-style and C++ style allocation and deallocation?[^]«_Superman_» _I love work. It gives me something to do between weekends.