What's the difference between calloc() and malloc()?
Answer Posted / valli
the diffence is
1.prototype or no of arguments
calloc takes two arguments
where as malloc takes 1 argument
void *calloc(int ,int);
first argument is no of blocks required
secund argument is no of elementts in each block required
void *malloc(int);
in this total no of bytes reuired are taken as the argument
2.
calloc clears the bytes which are allocated or reserved
where malloc can not guarentee this
sorry for my poor english
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Explain the difference between call by value and call by reference in c language?
Can we access array using pointer in c language?
How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
What is stack in c?
Define Spanning-Tree Protocol (STP)
How can I direct output to the printer?
Explain how do you declare an array that will hold more than 64kb of data?
write a c program to find the sum of five entered numbers using an array named number
What is the maximum length of an identifier?
What is a char in c?
Why is it that not all header files are declared in every C program?
What are the data types present in c?
Why do we use & in c?
What is a c token and types of c tokens?
How will you declare an array of three function pointers where each function receives two ints and returns a float?