download Mastguru Android App

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 dangling pointer in c

  • if pointer is pointing to a memory location from where variable has been deleted
  • if pointer is assigned to more than one variable
  • if pointer is not defined properly
  • none of above

2. What is the purpose of getc()

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

3. 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

4. The compiler in C ignores all text till the end of line using

  • //
  • /
  • */
  • none of above

5. What will be output of
#include
void main()
{
char test =`S`;
printf("\n%c",test);
}

  • S
  • Error
  • Garbage value
  • None of above
Read more from - C Programming Questions Answers - Chapter 1
Post a comment