What's the difference between calloc() and malloc()?

Answer Posted / bhaswati

malloc allocates m bytes means it takes one arguments.but calloc allocate m times n bytes and initialized the memory location to zero.it takes two arguments.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I use strcmp?

632


Difference between Shallow copy and Deep copy?

1562


Why is #define used?

786


What does it mean when a pointer is used in an if statement?

596


how to introdu5ce my self in serco

1517






How can you determine the size of an allocated portion of memory?

734


What does sizeof return c?

594


What should malloc() do?

637


Why c is called free form language?

561


Why static is used in c?

614


Can you please explain the scope of static variables?

597


Explain what is output redirection?

659


Why main is not a keyword in c?

639


Why structure is used in c?

577


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a

1445