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 difference between a string and an array?

0 Answers  


Explain what is the difference between functions abs() and fabs()?

0 Answers  


to find out the reverse digit of a given number

6 Answers   Infosys, Microsoft, TCS, Wipro,


How to swap 3 numbers without using 4th variable?

5 Answers  


int main() { int x = (2,3,4); int y = 9,10,11; printf("%d %d",x,y); } what would be the output?

7 Answers   Parimal, Wipro,






52.write a “Hello World” program in “c” without using a semicolon? 53.Give a method to count the number of ones in a 32 bit number? 54.write a program that print itself even if the source file is deleted? 55.Given an unsigned integer, find if the number is power of 2?

9 Answers  


WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.

0 Answers   Google, Infosys,


How can I ensure that integer arithmetic doesnt overflow?

0 Answers  


what is an ERP?

2 Answers   Infotech,


how many error occurs in C language ?

22 Answers   Infosys, Wipro,


write a program to display the numbers in the following format 4 4 3 3 3 3 2 2 2 2 2 2 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 2 2 2 2 2 3 3 3 4

9 Answers   IBM, NIIT, Winit,


1.what are local and global variables? 2.what is the scope of static variables? 3.what is the difference between static and global variables? 4.what are volatile variables? 5.what is the use of 'auto' keyword? 6.how do we make a global variable accessible across files? Explain the extern keyword? 7.what is a function prototype? 8.what does keyword 'extern' mean in a function declaration?

0 Answers  


Categories