Skip to content

Latest commit

 

History

History

0x0B-malloc_free

img

Dynamic memory allocation

meme

Intro

Dynamic memory allocation is an important concept in C programming, allowing for efficient use of memory by allocating and freeing memory as needed. In this blog post, we will explore the use of the malloc function to dynamically allocate memory in C, including examples and best practices for proper usage

About

In this session, we well cover dyanamic memory allocation in C, why is it important and how it is implemted. Buckle up, it might get bumpy!!

Resources

  1. Dyamic memory alloation overview
  2. Youtube

Man/Help

  • malloc
  • free

Learning objectives

After going through the above resources, you should be able to explain to anyone without the help of Goolge the following concepts.

  • What is the difference between automatic and dynamic allocation
  • What is malloc and free and how to use them
  • Why and when use malloc
  • How to use valgrind to check for memory leak

More info

You can learn about calloc and realloc.

Quizes

Quiz