C Programming - Memory Allocation - Discussion

Discussion Forum : Memory Allocation - True / False Questions (Q.No. 2)
2.
malloc() allocates memory from the heap and not from the stack.
True
False
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
14 comments Page 2 of 2.

Purva said:   1 decade ago
Like stack is First in first out, how does heap work ?

Dev. said:   1 decade ago
malloc and calloc allocates memory in heap.

Saurabh said:   1 decade ago
Heap area consist of hash codes .i.e. addreses while stack may or may not be.

Likita shetty said:   1 decade ago
what is the difference between heap and stack .. i know stack works on the principle of last in first out and what about heap ?


Post your comments here:

Your comments will be displayed after verification.