Skip to content

ramasham/42_CPP_Modules

Repository files navigation

42 C++ Modules Collection (00 to 09)

Welcome to the comprehensive collection of 42 C++ Modules projects, covering modules 00 through 09. This repository contains the full progression of C++ projects from the 42 school curriculum, designed to teach modern C++ concepts, syntax, and best practices through hands-on assignments.


📚 Overview

The 42 C++ Modules are a series of incremental projects designed to develop your skills in C++ programming from beginner to advanced levels. Each module focuses on specific C++ features such as classes, inheritance, polymorphism, templates, exceptions, operator overloading, and advanced algorithms.


🚀 Modules Summary

Module 00 - Introduction to C++ and Basics

  • Understand the basic syntax and structure of C++ programs
  • Learn how to compile and run simple programs
  • Work with basic input and output streams
  • Practice control flow using loops and conditionals
  • Manipulate fundamental data types and variables

Module 01 - Classes and Objects

  • Grasp the concept of classes and object instantiation
  • Implement constructors and destructors for proper object lifecycle
  • Use access specifiers (public, private, protected) for encapsulation
  • Develop member functions and understand class methods
  • Apply basic principles of object-oriented design

Module 02 - Ad-hoc Polymorphism, Operator Overloading, The Orthodox Canonical Form

  • Learn the Rule of Three/Five/Zero for safe resource management
  • Implement copy constructors, assignment operators, and destructors
  • Overload operators to customize class behavior (e.g., arithmetic, assignment)
  • Understand ad-hoc polymorphism through operator overloading
  • Avoid common pitfalls such as shallow copies and memory leaks

Module 03 - Inheritance and Polymorphism

  • Build inheritance hierarchies with base and derived classes
  • Override virtual functions to enable runtime polymorphism
  • Design abstract classes and interfaces for flexible code architecture
  • Explore dynamic binding and virtual function tables
  • Create polymorphic containers and manage heterogeneous objects

Module 04 - More Advanced Inheritance and Polymorphism

  • Handle complex inheritance using virtual inheritance techniques
  • Work with abstract base classes for enforcing interfaces
  • Understand multiple inheritance and its challenges
  • Ensure correct resource cleanup with virtual destructors
  • Refine class hierarchies for extensibility and maintainability

Module 05 - Repetition and Exceptions

  • Revisit operator overloading for arithmetic, comparison, and stream operators
  • Deepen understanding of exception handling with try, catch, and throw
  • Create custom exception classes for specialized error reporting
  • Manage program flow and resource cleanup in the presence of exceptions
  • Apply exception safety guarantees to maintain robust applications

Module 06 - Casting

  • Master function and class templates for generic programming
  • Learn template specialization and partial specialization
  • Practice safe and effective type casting within template code
  • Understand static, dynamic, const, and reinterpret casts
  • Write reusable and flexible code leveraging template mechanisms

Module 07 - Templates and Generic Programming

  • Expand template skills to build templated containers and algorithms
  • Implement generic algorithms that work with multiple data types
  • Explore template metaprogramming basics and compile-time computation
  • Learn to balance code flexibility with performance considerations
  • Harness the power of the Standard Template Library (STL)

Module 08 - Advanced Topics (Templated Containers, Iterators, Algorithms)

  • Deep dive into STL containers and their iterator interfaces
  • Create and use functors and callable objects effectively
  • Utilize lambda expressions for concise and powerful inline functions
  • Apply STL algorithms for searching, sorting, and transforming data
  • Write clean, maintainable, and efficient code using modern C++ idioms

Module 09 - Final Project: RPN, PmergeMe & Others

  • Implement advanced algorithms such as the Ford-Johnson merge-insert sort
  • Develop a Reverse Polish Notation (RPN) calculator
  • Use STL containers like vector and deque to manage data efficiently
  • Optimize performance through algorithmic improvements
  • Demonstrate integration of learned concepts into practical projects

🛠️ Requirements

  • C++ compiler (g++ or clang++) supporting C++98 and later standards
  • Make utility (for building projects)
  • Linux or macOS recommended (compatible with 42 school environment)

This repository is crafted as a comprehensive resource to deepen your understanding and mastery of C++ through hands-on projects aligned with the 42 curriculum.

Enjoy your C++ learning journey! 🚀

About

Mastering C++ OOP: From Basics to Polymorphism — 42 Module Series

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors