A comprehensive journey through Object-Oriented Programming, manual memory management, and the Standard Template Library (STL) in C++98.
This repository contains my solutions for the core C++ modules (00 - 09) completed at the 1337 coding school (42 Network). The project transitions from procedural C to object-oriented C++, focusing heavily on safe memory handling, ad-hoc and subtype polymorphism, and generic programming.
| Module | Focus | Key Concepts Explored |
|---|---|---|
| CPP 00 | Basics & OOP | Namespaces, classes, member functions, standard I/O streams, and encapsulation. |
| CPP 01 | Memory Management | Manual allocation (new/delete), pointers vs. references, and file streams. |
| CPP 02 | Ad-Hoc Polymorphism | Operator overloading, Orthodox Canonical Form, and fixed-point arithmetic. |
| CPP 03 | Inheritance | Base and derived classes, access specifiers, and code reusability. |
| CPP 04 | Subtype Polymorphism | Abstract classes, interfaces, virtual functions, and deep vs. shallow copying. |
| CPP 05 | Exceptions | Standard C++ try/catch blocks, custom exception classes, and robust error handling. |
| CPP 06 | C++ Casts | Type conversion constraints: static_cast, dynamic_cast, reinterpret_cast, const_cast. |
| CPP 07 | Templates | Generic programming, type-independent functions, and class templates. |
| CPP 08 | Templated Containers | Standard containers (std::vector, std::list, etc.), iterators, and algorithms. |
| CPP 09 | Advanced STL | High-performance data processing and complex algorithms, including Ford-Johnson merge-insertion sort. |
All projects are written in strict C++98 standard. Each module contains its own sub-directories with a Makefile for easy compilation.
To compile any specific exercise:
cd CPP_0X/ex0Y
make
./<executable_name>make - Compiles the source files into the executable.
make clean - Removes object files.
make fclean - Removes object files and the executable.
make re - Recompiles the entire project.
Orthodox Canonical Form: From CPP 02 onwards, all classes strictly implement the default constructor, copy constructor, copy assignment operator, and destructor.
No Memory Leaks: Standardized manual memory management. All dynamically allocated memory is properly freed.
Standard: Compiled with c++ -Wall -Wextra -Werror -std=c++98.
Developed by Soufiane El Abboubi