Which is better between malloc and calloc?
Answer / Jaiprakash
"Both 'malloc' and 'calloc' are used for dynamic memory allocation in C. 'malloc' simply allocates a block of memory without initializing it, while 'calloc' initializes the allocated memory to zero. When you need uninitialized memory, use malloc. If you require memory with all elements initialized to zero, use calloc."n
| Is This Answer Correct ? | 0 Yes | 0 No |
What are the languages are portable and platform independent?Why they are like that?
Why dont c comments nest?
How can I write a function analogous to scanf?
Which is the best sort method for library management?
what is memory leak?
Why is sizeof () an operator and not a function?
What is sizeof int?
Write a simple code fragment that will check if a number is positive or negative.
Write a C function to search a number in the given list of numbers. donot use printf and scanf
To what value do nonglobal variables default? 1) auto 2) register 3) static
How can I recover the file name given an open stream?
How do I create a directory? How do I remove a directory (and its contents)?