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. Out of following program :
float x = 10.7;
int i;

i = (int) x;
print i;

  • null
  • error
  • 10
  • garbage value

2. To access the members of structure which symbol is used

  • *
  • -
  • ,
  • .

3. What will be the output of following program
#include
main()
{
int x,y = 10;
x = y * NULL;
printf(\"%d\",x);
}

  • error
  • 0
  • 10
  • Garbage value

4. Can getch() be used to echo the input

  • Yes
  • No

5. What is prototype of a function in C

  • It is the return type of a function
  • It is the return data of the function
  • It is declaration of a function
  • It is a datatype
Read more from - C Programming Questions Answers - Chapter 1
Post a comment