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.
- Dynamic Memory Allocation in C
- C Library Function - malloc()
- Understanding malloc, free, calloc, and realloc in C
- Memory Management in C
- How to use the
exit
function. - What are the functions
calloc
andrealloc
from the standard library and how to use them.
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. |