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

how to write a c program to print list of fruits in alpabetical order?

2079


What is the hardest programming language?

918


What is a structure and why it is used?

870


How can a process change an environment variable in its caller?

937


write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list

2543


What is the difference between arrays and pointers?

866


What is strcmp in c?

763


what is the structure pointer?

1872


What is the difference between array and pointer?

791


Is it better to use malloc() or calloc()?

853


pierrot's divisor program using c or c++ code

1982


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

872


What will the preprocessor do for a program?

795


What is the difference between the local variable and global variable in c?

746


What is the benefit of using an enum rather than a #define constant?

957