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


Please Help Members By Posting Answers For Below Questions

Why isnt there a numbered, multi-level break statement to break out

589


How will you declare an array of three function pointers where each function receives two ints and returns a float?

783


Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings

2251


What are the different properties of variable number of arguments?

669


What is static function in c?

635






How does normalization of huge pointer works?

641


Why c is known as a mother language?

646


What is volatile variable how do you declare it?

566


illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question

1585


What is chain pointer in c?

603


What is C language ?

1530


What is a method in c?

628


What is pointer & why it is used?

604


What is the use of parallelize in spark?

576


How can I sort more data than will fit in memory?

630