WHAT IS THE DIFFERENCE BETWEEN malloc() and calloc() in c
file management?
Answer Posted / md ajij
1.malloc() allocate one block of space in memory , argument
of the malloc is the size of the block.
where as calloc() allocate multiple blocks in the memory
,argument of the malloc() is the size of a block and number
of blocks.
2. malloc() takes garbage value at the initial time where
initial value of calloc() is zero.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How many levels of indirection in pointers can you have in a single declaration?
What is property type c?
What is identifier in c?
What are the two forms of #include directive?
What are the advantage of c language?
What is typedf?
What is a macro, and explain how do you use it?
When is a null pointer used?
Why is c still so popular?
What is a const pointer?
What is substring in c?
Which header file should you include if you are to develop a function which can accept variable number of arguments?
Explain 'bus error'?
Is c compiled or interpreted?
What is an auto keyword in c?