Explain dynamic memory allocation functions?

: 547
Paper : C Programming FAQ (Frequently Asked Questions and answers) for freshers | Platform : Procedural Programming Languages | Category : Programming FAQs

Dynamic memory allocation has three functions for allocating memory.

  • malloc():   ptr = (cast-type*) malloc(byte-size);
  • calloc():  ptr = (cast-type*)calloc(n, element-size);
  • realloc():  ptr = realloc(ptr, newsize);
Suggested Papers: