Skip to content

LaNguAx/Polymorphism

Repository files navigation

Polymorphism — Simple Shape Hierarchy in Modern C++

Demonstrates runtime polymorphism with a Shape base class and concrete Circle, Square, and Quad types.

✨ Core files

Class/File Highlights
Shape Pure‑virtual area() / perimeter()
Circle Stores center, radius
Square Stores origin and side length
Quad Four‑point arbitrary quadrilateral
allShapes Factory & polymorphic collection demo
MainTrain Unit‑test‑style harness

📝 Customising

  • Add new shapes by inheriting Shape and overriding its virtual methods.
  • Replace raw pointers with smart pointers for automatic memory handling.

⚖️ License

MIT

About

ex3cpp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages