Skip to content

Files

0x0C-more_malloc_free

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Sep 7, 2023
Sep 7, 2023
Sep 7, 2023
Sep 7, 2023
Sep 8, 2023
Sep 8, 2023
Sep 9, 2023
Sep 7, 2023
Sep 7, 2023
Sep 8, 2023
Sep 8, 2023
Oct 13, 2024
Sep 8, 2023

0x0C-more_malloc_free

Description

This project focuses on dynamic memory allocation in C using malloc, free, and other related functions. It covers how to allocate memory, handle allocation errors, and free allocated memory to avoid memory leaks.

Resources

Read or watch

Learning Objectives

General

  • How to use the exit function.
  • What are the functions calloc and realloc from the standard library and how to use them.

Tasks

Task File Description
0. Trust no one 0-malloc_checked.c Writes a function that allocates memory using malloc.
1. string_nconcat 1-string_nconcat.c Writes a function that concatenates two strings.
2. _calloc 2-calloc.c Writes a function that allocates memory for an array, using malloc.
3. array_range 3-array_range.c Writes a function that creates an array of integers.
4. _realloc 100-realloc.c Writes a function that reallocates a memory block using malloc and free.
5. We must accept finite disappointment, but never lose infinite hope 101-mul.c Writes a program that multiplies two positive numbers.