+ 1
What is malloc and calloc in c program?
experts . please help me
2 ответов
+ 7
malloc:
The name malloc stands for "memory allocation".
The function malloc() reserves a block of memory of specified size and return a pointer of type void which can be casted into pointer of any form.
calloc:
The name calloc stands for "contiguous allocation".
The only difference between malloc() and calloc() is that, malloc() allocates single block of memory whereas calloc() allocates multiple blocks of memory each of same size and sets all bytes to zero.
check this link to know the difference in table:
http://cs-fundamentals.com/tech-interview/c/difference-between-malloc-and-calloc.php
0
cmon, a simple google sesrch is enough