difference between malloc and calloc how free deallocates memory
Anónimo
malloc() allocates memory block of given size (in bytes) and returns a pointer to the beginning of the block. malloc() doesn’t initialize the allocated memory calloc() allocates the memory and also initializes the allocated memory block to zero. If we try to access the content of these blocks then we’ll get 0 free() should only be used for the pointers pointing to the memory, it does not call the destructor of that object Both of these are not used much in C++ because we have New and Delete