Question Detail

Difference between calloc() and malloc()

  • calloc() takes a single argument while malloc() needs two arguments
  • malloc() takes a single argument while calloc() needs two arguments
  • malloc() initializes the allocated memory to ZERO
  • calloc() initializes the allocated memory to NULL
Similar Questions :

1. Size of void pointer is

  • 1 byte
  • 2 byte
  • 4 byte
  • 8 byte

2. printf() belongs to which library of c

  • stdlib.h
  • stdio.h
  • stdout.h
  • stdoutput.h

3. calloc() belongs to which library

  • stdlib.h
  • malloc.h
  • calloc.h
  • None of above

4. Continue statement used for

  • To continue to the next line of code
  • To stop the current iteration and begin the next iteration from the beginning
  • To handle run time error
  • None of above

5. Break statement is used for

  • Quit a program
  • Quit the current iteration
  • Both of above
  • None of above
Read more from - C Programming Questions Answers - Chapter 1