C Programming - Memory Allocation - Discussion
Discussion Forum : Memory Allocation - General Questions (Q.No. 2)
2.
What function should be used to free the memory allocated by calloc() ?
Discussion:
22 comments Page 2 of 3.
Pandiya raja said:
1 decade ago
@Lijina. What is malloc() and calloc() ?
Can you explain with example program ?
Can you explain with example program ?
(1)
Lijina said:
1 decade ago
malloc() and calloc() are used to allocate space in memory but one difference is there allocating methods.
malloc() : malloc(int) only passing one arguments int allocates 2 bytes.
calloc() : calloc(int,5) passing two arguments int allocates 2 bytes, also 5 times 2 bytes will allocates.
malloc() : malloc(int) only passing one arguments int allocates 2 bytes.
calloc() : calloc(int,5) passing two arguments int allocates 2 bytes, also 5 times 2 bytes will allocates.
Sri said:
1 decade ago
What are the functions of malloc and calloc?
Krishna said:
1 decade ago
Both allocate storage memory but the difference is malloc process single argument so just specify storage space while calloc process double argument so specify no. Of variable and space needed for that variable.
Pokar sanjay said:
1 decade ago
How is different between malloc() and calloc() what is function of both? How it work?
Amrendra said:
1 decade ago
The free(var-name) is only function in c to deallocate memory.
Venkat said:
1 decade ago
Mainly free() function is used for allocating free memory for malloc() and calloc().
Hari naidu said:
1 decade ago
free() function is used to remove the allocated memory.
Anil kumar said:
1 decade ago
free() is one of the predefined function its free memory ...
only one function is there in c language to free memory....
only one function is there in c language to free memory....
Rahul said:
1 decade ago
There are only 3 memory allocation functions in C calloc(),malloc() and free(). free is to free that allocated space
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers