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
Can you please explain the difference between malloc() and calloc() function?
What are examples of structures?
What is a void * in c?
Is c dynamically typed?
What is array of structure in c?
please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code
What is a pointer on a pointer in c programming language?
write a program to display all prime numbers
program for reversing a selected line word by word when multiple lines are given without using strrev
What is 2c dna?
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
How reliable are floating-point comparisons?
Explain the term printf() and scanf() used in c language?
What is main return c?
What is logical error?