This repository contains the 10 C++ modules from the 42 school curriculum. The goal is to progressively master C++ fundamentals under the C++98 standard, moving from procedural C-style thinking to advanced Object-Oriented Programming (OOP).
- OOP: Encapsulation, inheritance, polymorphism, abstraction.
- Memory Management: Stack vs heap, avoiding leaks, RAII.
- C++ Idioms: Orthodox Canonical Form, operator overloading, exception safety.
- Generic Programming: Templates, reusability.
- STL Mastery: Containers, iterators, algorithms.
- Standard: All projects follow the C++98 standard (42 requirement).
- Constraints: No external libraries; focus on understanding fundamentals over modern shortcuts.
- Documentation: Includes the documented learning process and solved challenges.
- Concepts: Namespaces (
std), I/O streams, classes, member functions,thispointer, static members. - Takeaway: Transition from C to C++, object-oriented thinking.
- Concepts: Stack vs heap,
new/delete, pointers vs references, file I/O. - Takeaway: Memory management and avoiding leaks.
- Concepts: Constructors/destructors, copy constructor, copy assignment operator, operator overloading.
- Takeaway: Rule of 3 and object copying semantics.
- Concepts: Base/derived classes, method overriding, access specifiers, constructor/destructor chaining.
- Takeaway: Code reuse and hierarchical design.
- Concepts: Virtual functions, dynamic binding, abstract classes, deep vs shallow copy.
- Takeaway: Runtime polymorphism and interface-based design.
- Concepts:
try/catch/throw, custom exception classes, RAII. - Takeaway: Robust error handling.
- Concepts:
static_cast,dynamic_cast,reinterpret_cast,const_cast. - Takeaway: Explicit and safe type conversions.
- Concepts: Function templates, class templates, generic programming.
- Takeaway: Reusable, type-independent code.
- Concepts:
vector,list, iterators,std::find,std::sort. - Takeaway: Efficient use of STL.
- Concepts:
map,set, data processing algorithms. - Takeaway: Combining STL tools for problem solving.
- Highlight: ex02 — PmergeMe — implementation of the Ford-Johnson merge-insertion sort with detailed complexity analysis.
-
Clone the repository:
git clone git@github.com:aphonogelia/CPP.git
-
Navigate to an exercise:
cd CPP00/ex00 -
Compile and Run:
make ./executable_name
- 42 C++ Curriculum: https://42.fr/en/the-program/innovative-learning/