Skip to content

natamun/42-cpp03

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42-cpp03

The fourth C++ module of the 42 curriculum, focused on inheritance.

This project explores single and multi-level inheritance, constructor/destructor chaining across a class hierarchy, and how derived classes extend or override base class behavior.

Usage

Each exercise (ex00 to ex03) contains its own Makefile. Compile and run individually:

cd ex00
make
./ex00

Exercises

  • ex00: Basic class design (ClapTrap) with attributes, constructors, and member functions.
  • ex01: Single inheritance (ScavTrap) extending ClapTrap with new behavior.
  • ex02: Multi-level inheritance (FragTrap) building on ScavTrap.
  • ex03: Diamond inheritance and constructor/destructor call order (DiamondTrap).

Code Structure

Each exercise is self-contained in its own directory with its own source files, header, and Makefile, following the standard 42 module layout.

About

Inheritance in C++: single, multi-level, and diamond hierarchies

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages