Can you please explain the difference between malloc() and calloc() function?



Can you please explain the difference between malloc() and calloc() function?..

Answer / Mithilesh Kumar Pandey

"malloc() and calloc() are both used for dynamic memory allocation in C. The main difference lies in the initialization of allocated memory: malloc() initializes the memory with garbage values, while calloc() initializes each byte to zero."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

What is selection sort in c?

1 Answers  


How to declare pointer variables?

1 Answers  


What does main () mean in c?

1 Answers  


my name is nani i completed my b-tech in hyd now i want go for interveiw but i dont know the process of software field interveiws plz help me anyone how many rouds there n what rounds plz plz plz help me n where i can get these details

2 Answers  


What is the sizeof () a pointer?

1 Answers  


Define macros.

1 Answers   Tech Mahindra,


What are identifiers and keywords in c?

1 Answers  


What is a union?

1 Answers  


PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM

0 Answers  


Write a code of a general series where the next element is the sum of last k terms.

1 Answers   Aspiring Minds,


What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

1 Answers  


What is a substring in c?

1 Answers  


Categories