Welcome to my C++ learning repository! This project is dedicated to mastering Object-Oriented Programming (OOP) concepts using C++.
This repository contains a series of C++ modules (CPP00 through CPP05) that progressively explore fundamental and advanced OOP concepts. Each module includes multiple exercises designed to build a solid foundation in C++ programming.
cpp_projects/
├── CPP00/ # Module 00 - Introduction to C++
│ ├── ex00/
│ ├── ex01/
│ └── ex02/
├── CPP01/ # Module 01 - Memory allocation, references, pointers
├── CPP02/ # Module 02 - Ad-hoc polymorphism, operators overloading
├── CPP03/ # Module 03 - Inheritance
├── CPP04/ # Module 04 - Subtype polymorphism, abstract classes, interfaces
└── CPP05/ # Module 05 - Repetition and exceptions
Throughout these modules, I'm learning and practicing:
- Basic C++ Syntax: Understanding fundamental C++ constructs
- Classes and Objects: Implementing OOP principles
- Memory Management: Working with dynamic memory allocation
- References and Pointers: Understanding memory addressing
- Operator Overloading: Customizing operators for classes
- Inheritance: Creating hierarchical class structures
- Polymorphism: Both compile-time and runtime polymorphism
- Abstract Classes and Interfaces: Designing flexible architectures
- Exception Handling: Writing robust error-handling code
- Language: C++ (96.9%)
- Build System: Makefile (3.1%)
- Compiler: C++ compiler with C++98 standard (or higher)
- C++ compiler (g++, clang++, etc.)
- Make utility
Each module contains exercises with their own Makefiles. To compile and run an exercise:
# Navigate to the desired module and exercise
cd CPP00/ex00
# Build the project
make
# Run the executable
./[executable_name]
# Clean build files
make clean # Remove object files
make fclean # Remove object files and executable
make re # Rebuild from scratchIntroduction to the fundamentals of C++, including namespaces, classes, member functions, stdio streams, initialization lists, static and const keywords. This module covers the basic building blocks needed to write C++ programs and introduces object-oriented programming concepts.
Deep dive into dynamic memory allocation, pointers to members, references, and understanding the difference between stack and heap memory. Learn about memory leaks, proper resource management, and the importance of destructors in C++.
- Dynamic Memory Allocation
- Pointers vs References
- Memory Management
- Stack vs Heap Memory
- RAII Pattern
Understanding operator overloading, fixed-point numbers, and the orthodox canonical class form (Coplien form). This module teaches how to make custom types behave like built-in types and properly manage copy semantics.
Exploring inheritance hierarchies, access specifiers, and understanding the diamond problem in multiple inheritance. Learn how to create class hierarchies and understand the relationship between base and derived classes.
Working with abstract classes, interfaces, pure virtual functions, and runtime polymorphism through virtual functions. Understanding how to design flexible and extensible class hierarchies using polymorphic behavior.
Mastering exception handling, understanding stack unwinding, and learning how to write robust error-handling code. This module also reinforces concepts from previous modules through repetition and practical application.
- All code follows C++98 standard (unless specified otherwise)
- Each exercise builds upon concepts from previous modules
- Makefiles include flags for strict compilation (-Wall -Wextra -Werror)
Abdellahsyani
This project is created for educational purposes.
This is a personal learning repository, but feel free to open issues if you spot any problems or have suggestions!
Happy Coding! 🚀