1.

What Is The Difference Between Malloc() And Calloc()?

Answer»

Calloc:

  • Allocates a REGION of memory LARGE enough to hold "N” elements of "size" bytes each.
  • Calloc initializes the whole memory with 0

Malloc:

  • Allocates "size" bytes of memory.
  • Malloc does not change the EXISTING memory. So it returns a memory chunk with garbage VALUE

Calloc:

Malloc:



Discussion

No Comment Found