This project demonstrates the use of structures and typedef in C programming.
- What are structures, when, why and how to use them
- How to use typedef
- Understanding struct member access and initialization
- Dynamic memory allocation with structures
- dog.h - Header file with struct dog definition and typedef
- 1-init_dog.c - Function that initializes a variable of type struct dog
- 2-print_dog.c - Function that prints a struct dog
- 4-new_dog.c - Function that creates a new dog with memory allocation
- 5-free_dog.c - Function that frees dogs
All files are compiled with:
gcc -Wall -Werror -Wextra -pedantic -std=gnu89
Structures and typedef mastery achieved!