What is the difference between malloc() and calloc()?

Answer Posted / hr@tgksolutions.com

 malloc(): Allocates a single block of memory without initializing it.
 calloc(): Allocates multiple blocks of memory and initializes them to zero.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the meaning of keyword 'extern' in a function declaration.

926


Can two or more operators such as and be combined in a single line of program code?

1115


What are the advantages of c preprocessor?

981


What happens if a header file is included twice?

798


What is string function c?

788


how to construct a simulator keeping the logical boolean gates in c

1996


What are the uses of null pointers?

786


What is an arrays?

834


What are enums in c?

842


How can you determine the maximum value that a numeric variable can hold?

889


What are the advantages of external class?

796


Differentiate between a for loop and a while loop? What are it uses?

921


How can I automatically locate a programs configuration files in the same directory as the executable?

863


Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.

862


What are the types of operators in c?

801