A demonstration of how the C programming language can have better encapsulation than other languages if used correctly.
- Ubuntu 20.04 LTS
sudo apt install \
build-essential \
clang \
gcc \
valgrind
make clear
make
./encapsulation
valgrind --leak-check=full --track-origins=yes ./encapsulation
- The data may have to be allocated dynamically because the required space may not be possible to calculate otherwise.
- It may be possible to only hide all fields.
Clean Architecture book for demonstrating this technique.