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
What are the benefits of organizational structure?
What is function in c with example?
Describe newline escape sequence with a sample program?
Which is more efficient, a switch statement or an if else chain?
Can one function call another?
Explain what is the benefit of using enum to declare a constant?
Write a program to generate random numbers in c?
Explain two-dimensional array.
What is the difference between Printf(..) and sprint(...) ?
Differentiate between functions getch() and getche().
What is assert and when would I use it?
Can true be a variable name in c?
where are auto variables stored? What are the characteristics of an auto variable?
What do you mean by c?
How is actual parameter different from the formal parameter?