Answer Posted / bijaya
1)malloc() function does not initialize the memory which it
allocates thats why it takes the garbage value.but calloc()
function initializes the allocated memory to zero thats why
it cant take any garbage value.
2)malloc() function takes single arg.that is the variabe
which is used to indicate the memory size to be
allocated.calloc() function takes two args-i) variable which
indicates the number of memory blocks.ii)variable which
indicates the size of each blocks.
Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
What does calloc stand for?
What is pivot in c?
Explain what are the standard predefined macros?
How can I get random integers in a certain range?
while initialization of array why we use a[][2] why not a[2][]...?
In C language, a variable name cannot contain?
Explain the difference between the local variable and global variable in c?
What is the size of enum in bytes?
Can we replace the struct function in tree syntax with a union?
What is volatile variable in c with example?
What is include directive in c?
Why can't I perform arithmetic on a void* pointer?
Why should I use standard library functions instead of writing my own?
Which header file should you include if you are to develop a function which can accept variable number of arguments?
Is it possible to initialize a variable at the time it was declared?