Skip to content

Latest commit

 

History

History

0x0A-malloc_free

0x0A. C - malloc, free

About

An introductory project on:

  • The difference between automatic and dynamic allocation
  • Why and when to use malloc and free
  • How to use valgrind

Requirements

  • Ubuntu 14.04
  • gcc 4.8.4

File Descriptions

Mandatory

0-create_array.c - function that creates an array of chars, and initializes it with a specific char.

1-strdup.c - function that returns a pointer to a newly allocated space in memory, which contains a copy of the string given as a parameter.

2-str_concat.c - function that concatenates two strings.

3-alloc_grid.c - function that returns a pointer to a 2 dimensional array of integers.

4-free_grid.c - function that frees a 2 dimensional grid previously created by the function found in 3-alloc_grid.c.

5-argstostr.c - function that concatenates all the arguments of the program.

Advanced

100-strtow.c - function that splits a string into words.