Skip to content

ngtina99/cpp04

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ Module 04

This module explores subtype polymorphism, abstract classes, and interfaces in C++. You will build an inheritance tree of animals and magical materia systems to practice virtual functions, deep copies, and multiple inheritance concepts.

🛠️ Usage

For each exercise, navigate to its folder, compile, and run:

📂 ex00

cd ex00
make
./ex00

📂 ex01

cd ex01
make
./ex01

📂 ex02

cd ex02
make
./ex02

📝 Exercise Descriptions

ex00 — Polymorphism: Create an Animal base class, with derived Dog and Cat classes. Demonstrate virtual functions and subtype polymorphism. Include a WrongAnimal / WrongCat example to show the effect without virtual functions.

ex01 — I don’t want to set the world on fire: Add a Brain class to Dog and Cat for deep copy tests. Manage dynamic memory carefully to avoid leaks.

ex02 — Abstract class: Make Animal an abstract base class to prevent direct instantiation. Keep polymorphic behavior intact.

💼 Connect

If you have any questions or suggestions, feel free to connect: 🔗 LinkedIn: Valentina Nguyen 🙋‍♀️

🖥️ System Compatibility

This project was developed and tested on Linux (Ubuntu).

About

About subtype polymorphism, abstract classes, and interfaces to enhance code flexibility and design

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors