This repository contains solutions for the C++ modules from 42 School curriculum, covering fundamental to advanced C++ programming concepts.
The C++ modules are designed to teach modern C++ programming from the ground up, starting with basic syntax and progressing to advanced topics like templates, STL containers, and algorithms.
- ex00: Megaphone - Basic string manipulation and output
- ex01: PhoneBook - Introduction to classes, objects, and basic I/O
- ex02: Account - Working with static members and file I/O
- ex00: BraiiiiiiinnnzzzZ - Stack vs Heap allocation
- ex01: Moar brainz! - Dynamic memory allocation with arrays
- ex02: HI THIS IS BRAIN - References and pointers
- ex03: Unnecessary violence - Object composition and references
- ex04: Sed is for losers - File manipulation and string replacement
- ex05: Harl 2.0 - Switch statements and member function pointers
- ex00: Fixed Point Numbers - Orthodox Canonical Class Form
- ex01: Towards a more useful fixed-point number class - Constructors and conversions
- ex02: Now we're talking - Operator overloading
- ex00: ClapTrap - Basic class implementation
- ex01: ScavTrap - Single inheritance
- ex02: FragTrap - Multiple inheritance concepts
- ex00: Polymorphism - Virtual functions and abstract classes
- ex01: I don't want to set the world on fire - Deep copy and memory management
- ex02: Abstract class - Pure virtual functions
- ex00: Bureaucrat - Exception handling basics
- ex01: Form up, maggots! - Custom exceptions
- ex02: No, you need form 28B, not 28C... - Abstract classes with exceptions
- ex03: At least this beats coffee-making - Factory pattern
- ex00: Conversion of scalar types - Static cast and type conversion
- ex01: Serialization - Reinterpret cast
- ex02: Identify real type - Dynamic cast and RTTI
- ex00: Start with a few functions - Function templates
- ex01: Iter - Template functions with iterators
- ex02: Array - Class templates
- ex00: Easy find - STL algorithms
- ex01: Span - Custom container implementation
- ex02: Mutated abomination - Advanced STL usage
- ex00: Bitcoin Exchange - File parsing and STL containers
- ex01: Reverse Polish Notation - Stack implementation
- ex02: PmergeMe - Advanced sorting algorithms
Each exercise includes a Makefile for compilation. To build any exercise:
cd module0X/exXX
makeAll projects are compiled with:
-Wall -Wextra -Werror-std=c++98
cd module00/ex01
make
./phonebook
# Commands: ADD, SEARCH, EXITcd module01/ex00
make
./zombiecd module09/ex01
make
./RPN "8 9 * 9 - 9 - 9 - 4 - 1 +"- Memory Management: Understanding stack vs heap, RAII principles
- Object-Oriented Programming: Classes, inheritance, polymorphism
- Exception Handling: Try-catch blocks, custom exceptions
- Templates: Generic programming, template specialization
- STL: Standard Template Library containers and algorithms
- C++98 Standard: Working within older C++ standards
- C++ compiler supporting C++98 standard (g++, clang++)
- Make utility
- Unix-like operating system (Linux, macOS)
This project follows 42 School coding standards:
- No comments in code
- Orthodox Canonical Class Form for classes
- Proper memory management (no leaks)
- Exception safety
- Const correctness
- Low-level memory management
- Object-oriented design patterns
- Template metaprogramming
- STL proficiency
- Exception-safe programming
- Performance optimization
This repository contains educational solutions. While contributions are welcome for improvements or bug fixes, please ensure they maintain the educational value and follow 42 School guidelines.
This project is part of 42 School curriculum. Please respect academic integrity policies when using this code.
Made with ❤️ at 42 School