WHAT IS THE DIFFERENCE BETWEEN malloc() and calloc() in c
file management?

Answer Posted / naresh guguloth(iiit,basar)b09

malloc():-
-------
It is used to allocate memory for one variable only.
int*hi=(int*)malloc(sizeof(int));
calloc():-
It is used to allocate memory for any array.
int*bye=(int*)calloc(sizeof(int),10)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you please explain the difference between malloc() and calloc() function?

621


What are examples of structures?

597


What is a void * in c?

597


Is c dynamically typed?

667


What is array of structure in c?

595






please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

1705


What is a pointer on a pointer in c programming language?

621


write a program to display all prime numbers

1456


program for reversing a selected line word by word when multiple lines are given without using strrev

1947


What is 2c dna?

608


the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above

606


How reliable are floating-point comparisons?

630


Explain the term printf() and scanf() used in c language?

597


What is main return c?

519


What is logical error?

605