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. What is the purpose of getc()

  • read a character from STDIN
  • read a character from a file
  • read all file
  • read file random

2. Structures can be used

  • to hold different datatypes
  • have pointers to structures
  • to assign to one another
  • all of above

3. Size of void pointer is

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

4. printf() belongs to which library of c

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

5. What is wild pointer in c

  • a pointer which we need to write in future
  • a pointer which has bad naming convention
  • a pointer which has no limit
  • a point which has not initialized
Read more from - C Programming Questions Answers - Chapter 1