Answer Posted / vara
There are two differences.
1) is the number of arguments. Malloc() takes a single
argument (memory required in bytes), while calloc() needs
two arguments (number of variables to allocate memory, size
in bytes of a single variable).
2)malloc() does not initialize the memory allocated, while
calloc() initializes the allocated memory to ZERO.
| Is This Answer Correct ? | 15 Yes | 2 No |
Post New Answer View All Answers
Explain two-dimensional array.
how to execute a program using if else condition and the output should enter number and the number is odd only...
When should a type cast not be used?
Is c compiled or interpreted?
What is operator precedence?
Explain void pointer?
State two uses of pointers in C?
Explain the red-black trees?
How can I recover the file name given an open stream?
Is int a keyword in c?
What are type modifiers in c?
What does malloc () calloc () realloc () free () do?
Explain how do you use a pointer to a function?
Explain the use of keyword 'register' with respect to variables.
What are dangling pointers in c?