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()?
memory.h
stdlib.h
string.h
dos.h
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
37 comments Page 3 of 4.

Kumar mani said:   1 decade ago
calloc() is better than malloc().

Anjireddy said:   1 decade ago
calloc(), malloc(), realloc(), free() are the functions for used for dynamic allocation of memory. So, They are predefined functions we can use them by including stdlib.h.

Vinutha said:   1 decade ago
What is free ();?

Ashu said:   1 decade ago
How calloc() is better than malloc? Explain with a example?

Bittubohemia said:   1 decade ago
How memory can be allocate in android? Can anyone explain?

Akash patel said:   1 decade ago
How we will decide which one is better calloc or malloc during memory allocation?

Yogeshkumar said:   1 decade ago
stdlib.h is the header file which contain predefine prototype for malloc() & calloc().

Gmdn said:   1 decade ago
malloc is called from user space. stdlib contains the extern declarations needed for malloc. The definition if malloc is present in stdlib (may be glib) which intern calls "brk".

This is system call which in calls sys_brk. This extends the heap memory by specified memory size.

Arathy s v said:   10 years ago
How malloc and calloc stored in heap section?

Girija sankar said:   10 years ago
I think it should be alloc.h. But it is not in the options. We can prefer standard library i.e (stdlib.h).


Post your comments here:

Your comments will be displayed after verification.