A compact, educational CRUD system for a hospital management scenario developed for the "Programming Language II" discipline at UESC's Computer Science Course.
Versão em Português 🇧🇷: README-pt_BR.md.
Authors:
- Arthur de Carvalho (CarvDev)
- Rafael Mota (rafaelmotafreitas)
Objective: Provide a clear, well-structured implementation in C that demonstrates core systems programming skills: modular design, dynamic data structures, memory management, and file-based persistence. The project is intended both as a learning exercise and as a showcase of the authors' C-language proficiency.
Key Features:
- Patient management: create, view, edit, remove records.
- Doctor management: create, view, edit, remove records.
- Appointment scheduling: create, view, edit, remove appointments linking patients and doctors.
- Console-based user interface with modularized code and clear separation between data logic and UI.
Tech Stack & Skills Demonstrated:
- Language: C (ISO C, idiomatic use of pointers, structs and arrays).
- Build:
Makefilewith simple targets to build and run the program usinggcc. - Memory management: low level memory manipulation with
memmove()and dynamic memory allocation (malloc/free), with doubling strategy and careful lifetime handling. - Data structures: custom linked lists and dynamic arrays to store records in memory.
- Recursion: recursive implementation of the Binary Search algorithm.
- CLI arguments: quick data export/reset and help menu on terminal.
- Bitwise operations: converting lowercase characters into uppercase without the
toupper()function. - Pointers: efficient data manipulation, pointer arithmetic and generic functions with
void*data type. - System calls: directory creation function defined with conditional compilation for portability on both Windows and POSIX systems.
- Timestamp management: for efficiently handling time oriented operations, such as appointments.
- Error handling: input buffer cleaning, string normalization and memory safety.
- File I/O: persistent storage using standard C file APIs (
fopen,fread,fwrite,fclose). - Modularization: split across headers and sources (
paciente.c/.h,medico.c/.h,agendamento.c/.h,auxiliar.c/.h) to demonstrate API design in C.
Repository Structure (high level):
main.c— program entry and menu looppaciente.c/paciente.h— patient CRUD logicmedico.c/medico.h— doctor CRUD logicagendamento.c/agendamento.h— appointment logic linking patients and doctorsauxiliar.c/auxiliar.h— helper utilities and I/O helpersMakefile— build and run targetsdados/— directory intended for persisted data files
Build & Run:
- Build: run
make(requiresgcc) - Run:
./hospital - Show help menu:
./hospital --help - Reset data:
./hospital --reset - Export data:
./hospital --export
Compatibility: The project is designed to be compatible with Windows, GNU/Linux and macOS/BSD operating systems.
License & Contribution:
This project is licensed under MIT, as stated in the LICENSE file. Contributions and improvements are currently not expected, as this project is considered finished.
