C Programming - Memory Allocation - Discussion
Discussion Forum : Memory Allocation - General Questions (Q.No. 1)
1.
Which header file should be included to use functions like malloc() and calloc()?
Discussion:
37 comments Page 4 of 4.
Ravindra said:
1 decade ago
Which one is better out of malloc() and calloc() to allocate memory for a variable ? Can any one please explain this ?
Soundarya kumari.b said:
1 decade ago
C dynamic memory allocation refer to perform the dynamic memory allocation is present in standard library namely malloc(), calloc(), realloc().
Muskaan said:
1 decade ago
int *x;
x = (int *)malloc(n * sizeof(int));
This will allocate n element array of int type elements.
x = (int *)malloc(n * sizeof(int));
This will allocate n element array of int type elements.
Arti dixit said:
1 decade ago
How many prototype related to memory allocation?
Ravi said:
1 decade ago
What is a header file?
Gayathri said:
1 decade ago
It is the files which helps us to use some library files in our program. And number of files are pre-created and stored as header file. We can use those files by giving the line #include<stdio.h>
".h" is the extension of header file.
".h" is the extension of header file.
Abhayraj said:
1 decade ago
malloc, calloc, realloc, free are functions used 4 dynamic memory allocation. 4 such functions we should include header file of standard library (stdlib.h).
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers