what is the difference between malloc() and calloc() function?



what is the difference between malloc() and calloc() function?..

Answer / amritha rose

malloc will allocate memory according to the size we
specified
calloc vil allocate memory as blockwise
and initialize by 0

Is This Answer Correct ?    9 Yes 1 No

Post New Answer

More C Interview Questions

What is the memory allocated by the following definition ? int (*x)[10];

4 Answers   ADITI, Wipro,


What is variable in c with example?

1 Answers  


How can a string be converted to a number?

0 Answers  


why r u join this company? give solid resons.

16 Answers   IBM, Infosys, TCS,


main() { int a,b; printf("%d,%d",scanf("%d%d",&a,&b)); } => do u mean above program's output... =>output will be:2,whatever you enter value for b. =>because scanf is a library fn which will return how many arguements it processes, and second value you are right mr.Satya but i found my self unable to understand that for the first time scanf returns the no of successful matches but how for the second time it returns the value of 'b'.while a function should return the same 'r' value every time.

1 Answers   Cisco,


Write a program to find factorial of a number using recursive function.

0 Answers   Global Logic, TCS,


What are the modifiers available in c programming language?

0 Answers  


we have to use realloc only after malloc or calloc ? or we can use initially with out depending on whether we are using malloc or calloc in our program ?

2 Answers  


the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b

0 Answers  


program to find the ASCII value of a number

8 Answers  


i want to know the procedure of qualcomm for getting a job through offcampus

0 Answers   HCL,


Are comments included during the compilation stage and placed in the EXE file as well?

0 Answers  


Categories