Skip to content

Latest commit

History

28 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

42 C++ Modules

A progression through 10 C++ modules (CPP00–CPP09) from the 42 school curriculum. Each module introduces key C++ concepts, building from basic object-oriented programming all the way to the Standard Template Library (STL).


Repository Structure

CPP-Modules/
├── CPP00/ # Namespaces, classes, basic I/O
├── CPP01/ # Memory allocation, references, pointers
├── CPP02/ # Operator overloading, Orthodox Canonical Form
├── CPP03/ # Inheritance
├── CPP04/ # Polymorphism, abstract classes, interfaces
├── CPP05/ # Exceptions
├── CPP06/ # C++ casts
├── CPP07/ # Templates
├── CPP08/ # Templated containers, iterators, algorithms
└── CPP09/ # STL in practice

Each module folder contains numbered exercise sub-folders (ex00, ex01, …), each with its own Makefile and source files.


Building & Running Exercises

Navigate to any exercise directory and use the following make targets:

cd CPP0X/exYY
make # Compile the exercise (produces the binary)
make re # Force full recompilation (fclean + all)
make clean # Remove compiled object files (.o)
make fclean # Remove object files and the compiled binary

Example — build and run CPP00 ex00:

cd CPP00/ex00
make
./megaphone "hello world"

All exercises are compiled with c++ -Wall -Wextra -Werror -std=c++98.


Module Overview

ModuleCore Concepts
CPP00Namespaces, classes, member functions, basic I/O
CPP01Memory allocation (new/delete), pointers, references
CPP02Operator overloading, Orthodox Canonical Form, fixed-point numbers
CPP03Inheritance (single & multiple, diamond problem)
CPP04Subtype polymorphism, abstract classes, interfaces
CPP05Exception handling (try/catch/throw)
CPP06C++ casts (static_cast, reinterpret_cast, dynamic_cast)
CPP07Function and class templates
CPP08STL containers, iterators, algorithms
CPP09STL in practice (map, stack, deque, Ford-Johnson sort)

Navigating the Exercises

Each module's README.md lists the exercises and the concept each one focuses on. A typical workflow:

  1. Read the module README.md for context.
  2. Enter the exercise directory (cd CPP0X/exYY).
  3. Study the source files, then make and run the binary.
  4. Use make fclean before moving to the next exercise.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages