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
What is the meaning of c in c language?
What is the difference between struct and union in C?
write a c program in such a way that if we enter the today date the output should be next day's date.
What are qualifiers?
How can I read a binary data file properly?
Why can’t constant values be used to define an array’s initial size?
write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a
What is %lu in c?
What is the right way to use errno?
What does 1f stand for?
What is #include conio h?
Do you know what are the properties of union in c?
Write a function that will take in a phone number and output all possible alphabetical combinations
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }
How to create struct variables?