WHAT IS THE DIFFERENCE BETWEEN malloc() and calloc() in c
file management?
Answer Posted / ananth kumar
malloc
Holds 1 argument data type
allocates memory byte equivalent to data type
not init alloted memory
Calloc
Holds 2 arguments, data type and number of datas (n)
allocates memory block equivalent to n * data type
clears alloted memory with 0
| Is This Answer Correct ? | 173 Yes | 39 No |
Post New Answer View All Answers
What is a pointer and how it is initialized?
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
What is the maximum no. of arguments that can be given in a command line in C.?
How to implement a packet in C
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
What is the best way to comment out a section of code that contains comments?
Is a house a shell structure?
Who developed c language and when?
What is a pointer in c plus plus?
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
What is the correct code to have following output in c using nested for loop?
#include
How can I read/write structures from/to data files?
Do string constants represent numerical values?