INTERVIEW QUESTIONS
PROGRAMMING LANGUAGES
DETAILS
Question: What are the differences between malloc() and calloc()?
What are macros? what are its advantages and disadvantages?
Answer: Both malloc and calloc are used for allocating memory dynamically.But the difference is,in malloc elements are not initialised and hence holding garbage values where as in calloc the elements are get initialised.<br><br>Macros are used for speed up the process.The disadvantage is they are not having type_check phenomenon.
|