Skip to content

Repository files navigation

C++ Projects

A collection of small, self-contained C++ programs written during my computer science studies, covering string algorithms, operator overloading, class hierarchies, file I/O and fractal rendering.

Every program is standard C++17 with no external dependencies, builds clean under -Wall -Wextra -Wpedantic, and takes its input from the command line or from a data file in its own directory.

Building

make

Binaries land in bin/. To build and run a single program:

make run-matrix3

Requires any C++17 compiler (g++ 7+, clang++ 5+, MSVC 2017+). Override the compiler with make CXX=clang++.

The projects

Project What it does
text-difference Measures how different two text files are using Levenshtein edit distance
euclidean-distance Distance between two points of arbitrary dimension
shape-hierarchy Abstract base class and runtime polymorphism over a container of shapes
matrix3 A 3x3 integer matrix class with overloaded arithmetic operators
master-file-update Sequential master file update: merges a transaction file into a master file
mandelbrot-ppm Renders the Mandelbrot set to a binary PPM image
sierpinski-carpet Draws the Sierpinski carpet fractal as SVG
library-catalogue Interactive bookshop catalogue: search, sort, edit and sell stock

Each directory has its own README describing the problem, the approach and how to run it.

Notes

These began as coursework exercises and have since been reworked: the programs now read their inputs from arguments rather than hard-coded paths, report errors instead of failing silently, and manage memory through the standard containers and smart pointers.

Two changes are worth calling out because they alter what the original code did:

  • sierpinski-carpet originally drew into an FLTK window through the Simple_window.h helper from Stroustrup's Programming: Principles and Practice using C++. That header was never checked in, so the program could not be built. It now writes SVG, which keeps the recursive geometry and drops the dependency.
  • mandelbrot-ppm and library-catalogue were written in C. They have been rewritten as C++ so that the whole repository is consistent.

About

Small Projects/Exercises done in C++

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages