Slide 1 Slide 2 1 Lecture 5 - Memory Layout and Allocation Slide 3 2 Rationale You have learnt how to grab memory using malloc() and free(). why we need to study different…