WHAT IS THE DIFFERENCE BETWEEN malloc() and calloc() in c
file management?
Answer Posted / abhishek pathak mnnit
1- malloc() takes one argument while calloc takes 2 argument.
2- default value of malloc is garvage while calloc is 0;
3- malloc allocate memory in contiguous form while calloc
allocate memory in contiguous form if not avilable the takes
diffrent place.
| Is This Answer Correct ? | 88 Yes | 18 No |
Post New Answer View All Answers
What is %d called in c?
What extern c means?
What does it mean when a pointer is used in an if statement?
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
When should a type cast be used?
What is #include conio h?
Explain the ternary tree?
Write a program to swap two numbers without using third variable in c?
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
What are type modifiers in c?
what is the format specifier for printing a pointer value?
What is meant by initialization and how we initialize a variable?
What is clrscr ()?
What is pointer to pointer in c language?