adplus-dvertising
frame-decoration

Question

Which of the following is/are true?

a.

calloc() allocates the memory and also initializes the allocates memory to zero, while memory allocated using malloc() has random data.

b.

malloc() and memset() can be used to get the same effect as calloc()

c.

Both malloc() and calloc() return 'void *' pointer

d.

All of the above

Answer: (d).All of the above

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of the following is/are true?

Similar Questions

Discover Related MCQs

Q. Which languages necessarily need heap allocation in the run time environment?

Q. malloc() returns a float pointer if memory is allocated for storing float's and a double pointer if memory is allocated for storing double's.

Q. malloc() allocates memory from the heap and not from the stack.

Q. Where does the uninitialized data gets stored in memory?

Q. malloc() returns a NULL if it fails to allocate the requested memory.

Q. If malloc() successfully allocates memory it returns the number of bytes it has allocated.

Q. Can We increase the size of dynamically allocated array?

Q. Can we increase the size of statically allocated array?

Q. When we dynamically allocate memory is there any way to free memory during run time?

Q. Local variables are stored in an area called ___________

Q. Choose the statement which is incorrect with respect to dynamic memory allocation.

Q. The type of linked list in which the node does not contain any pointer or reference to the previous node:

Q. The advantage of using linked lists over arrays is that ________

Q. Which of the following is an example for non linear data type?

Q. Why to use fflush() library function?

Q. Why is calloc() function used for?

Q. Which is the correct sequence of compilation process?