A simple C program that stores people's names and ages, then finds who is the oldest.
It demonstrates the use of structs, functions, and dynamic memory allocation.
- Input the number of people dynamically
- Register names and ages
- Automatically find and display the oldest person
- Uses
malloc()andfree()safely
This project focuses on:
- Working with structs and arrays of structs
- Using dynamic memory allocation (
malloc/free) - Handling input with
fgets()and cleaning buffers - Modularizing code with functions
# Compile
gcc -O2 -Wall -Wextra -o oldest_person main.c
# Run
./oldest_person##Author
Willian Ferreira da Costa.