Skip to content

Small C program that uses structs and dynamic memory allocation to find the oldest person in a list.

License

Notifications You must be signed in to change notification settings

WillianFerreiraDaCosta/oldestPerson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Find the Oldest Person in C

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.


Features

  • Input the number of people dynamically
  • Register names and ages
  • Automatically find and display the oldest person
  • Uses malloc() and free() safely

Learning Goals

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

How to Compile and Run

# Compile
gcc -O2 -Wall -Wextra -o oldest_person main.c

# Run
./oldest_person

##Author

Willian Ferreira da Costa.

About

Small C program that uses structs and dynamic memory allocation to find the oldest person in a list.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages