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
Write a simple code fragment that will check if a number is positive or negative.
Explain the difference between null pointer and void pointer.
Write a program to print all permutations of a given string.
Explain how does free() know explain how much memory to release?
What is the use of clrscr?
What is the usage of the pointer in c?
Are global variables static in c?
What is d'n in c?
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
How do you define structure?
State the difference between realloc and free.
Why c language?
What is the difference between text and binary i/o?
Stimulate calculator using Switch-case-default statement for two numbers
What are dangling pointers in c?