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

Answers were Sorted based on User's Feedback



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

Answer / nashiinformaticssolutions

 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

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

Answer / glibwaresoftsolutions

 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

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

Answer / 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

More C Interview Questions

9.how do you write a function that takes a variable number of arguments? What is the prototype of printf () function? 10.How do you access command-line arguments? 11.what does ‘#include<stdio.h>’ mean? 12.what is the difference between #include<> and #include”…”? 13.what are # pragma staments? 14.what is the most appropriate way to write a multi-statement macro?

1 Answers  


Is there something we can do in C but not in C++? Declare variable names that are keywords in C++ but not C.

2 Answers   Infosys,


void main() { int a[]={1,2,3,4,5},i; for(i=0;i<5;i++) printf("%d",a++); getch(); }

3 Answers  


Can the curly brackets { } be used to enclose a single line of code?

0 Answers  


write a program to fined second smallest and largest element in a given series of elements (without sorting)

9 Answers   Yahoo,


i need all types of question paper releted to "c" and other language.

0 Answers  


If 4 digits number is input through the keyboard, Write a program to calculate sum of its 1st & 4th digit.

12 Answers   Google,


what are the advantages & disadvantages of unions?

2 Answers  


What are the rules for identifiers in c?

0 Answers  


code for inverse a matrix

0 Answers  


1 What is a Data Structure?

1 Answers  


Which are low level languages?

0 Answers  


Categories