A comprehensive collection of C++ exercises exploring fundamental object-oriented programming concepts, designed to provide a solid foundation in C++ paradigms and techniques.
- What is cpp_modules?
- Modules Overview
- Learning Objectives
- Installation
- Usage
- Project Structure
- Credits
cpp_modules is a progressive series of C++ learning modules covering essential object-oriented programming topics. Each module is designed to build upon previous concepts, guiding developers through a structured learning path from C++ basics to advanced concepts like multiple inheritance and polymorphism.
The project complies with 42 School coding standards and implements modern C++98 best practices.
These modules are made to learn about:
- C++ Fundamentals: Syntax, classes, objects and encapsulation
- Memory Management: Dynamic allocation, RAII and resource management
- Advanced OOP: Inheritance, polymorphism and abstract classes
- Overloading: Operators and functions for greater expressiveness
- Best Practices: Orthodox canonical form and design patterns
- Debugging: Problem-solving techniques and memory management
Clone the repository:
git clone https://github.com/denuen/42_cursus.git
cd 42_cursus/cpp_modulesEach module can be compiled individually:
cd cpp_XX/exYY
makeEach exercise has its own executable:
# Example for cpp_00/ex00
cd cpp_00/ex00
make
./megaphone "Hello World"
# Example for cpp_03/ex01
cd cpp_03/ex01
make
./scavtrapConsult the specific README of each module for detailed instructions.
cpp_modules/
├── cpp_00/ # Introduction to C++
│ ├── ex00/ # Megaphone
│ ├── ex01/ # PhoneBook
│ └── ex02/ # Account Dreams
├── cpp_01/ # Memory and references
│ ├── ex00/ # Zombie allocation
│ ├── ex01/ # Zombie horde
│ ├── ex02/ # Brain references
│ ├── ex03/ # Human weapons
│ ├── ex04/ # File replacement
│ ├── ex05/ # Harl logging
│ └── ex06/ # Harl filter
├── cpp_02/ # Overloading and canonical forms
│ ├── ex00/ # Fixed point basics
│ ├── ex01/ # Fixed point conversions
│ ├── ex02/ # Fixed point operators
│ └── ex03/ # BSP algorithm
├── cpp_03/ # Inheritance
│ ├── ex00/ # ClapTrap base
│ ├── ex01/ # ScavTrap inheritance
│ ├── ex02/ # FragTrap multiple inheritance
│ └── ex03/ # DiamondTrap virtual inheritance
├── cpp_04/ # Polymorphism
│ ├── ex00/ # Animal polymorphism
│ ├── ex01/ # Brain deep copy
│ └── ex02/ # Abstract Animal class
├── cpp_05/ # Exception handling, forms, and bureaucracy
│ ├── ex00/ # Bureaucrat class and exceptions
│ ├── ex01/ # Form signing and validation
│ ├── ex02/ # Abstract forms and specialized forms
│ └── ex03/ # Intern and dynamic form creation
├── cpp_06/ # Type conversion, serialization, and RTTI
│ ├── ex00/ # ScalarConverter static class
│ ├── ex01/ # Pointer serialization
│ └── ex02/ # RTTI and dynamic_cast
├── cpp_07/ # Templates and dynamic arrays
│ ├── ex00/ # swap, min, max templates
│ ├── ex01/ # iter template function
│ └── ex02/ # Array template class
├── cpp_08/ # STL containers and advanced data structures
│ ├── ex00/ # easyfind template function
│ ├── ex01/ # Span class for min/max span
│ └── ex02/ # MutantStack with iterator support
└── cpp_09/ # Real-world data processing and STL
├── ex00/ # BitcoinExchange: CSV parsing and queries
├── ex01/ # RPN: Reverse Polish Notation calculator
└── ex02/ # PmergeMe: Sorting and benchmarking (Ford-Johnson algorithm)
Developed by denuen as part of the 42 School curriculum. Special thanks to the 42 community for guidance and inspiration during this C++ learning journey.