Skip to content

Latest commit

 

History

329 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ Projects - Object-Oriented Programming Journey

Welcome to my C++ learning repository! This project is dedicated to mastering Object-Oriented Programming (OOP) concepts using C++.

📚 About

This repository contains a series of C++ modules (CPP00 through CPP09) that progressively explore fundamental and advanced OOP concepts. Each module includes multiple exercises designed to build a solid foundation in C++ programming.

🗂️ Repository Structure

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
├── CPP06/          # Module 06 - C++ casts and serialization
├── CPP07/          # Module 07 - C++ templates
├── CPP08/          # Module 08 - Templated containers, iterators, algorithms
└── CPP09/          # Module 09 - STL containers

Every module folder has its own README.md detailing each exercise.

🎯 Learning Objectives

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
  • C++ Casts: Choosing between static, reinterpret and dynamic casts
  • Templates: Writing type-independent functions and classes
  • The STL: Containers, iterators and standard algorithms

🛠️ Technologies

  • Language: C++ (96.9%)
  • Build System: Makefile (3.1%)
  • Compiler: C++ compiler with C++98 standard (or higher)

🚀 Getting Started

Prerequisites

  • C++ compiler (g++, clang++, etc.)
  • Make utility

Building and Running

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 scratch

📖 Module Overview

Introduction 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.

📚 Resources

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++.

📚 Resources

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.

📚 Resources

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.

📚 Resources

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.

📚 Resources

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.

📚 Resources

Exploring the four C++ cast operators and when each one is the right tool: static_cast for well-defined conversions, reinterpret_cast for bitwise reinterpretation of addresses, and dynamic_cast with RTTI for safe downcasting. The module also covers scalar conversion, pointer serialization and identifying the real type of a polymorphic object at runtime.

📚 Resources

Writing code that works with any type: function templates, template argument deduction, higher-order functions taking a callable as a template parameter, and class templates with their implementation split into a .tpp file. Ends with a generic, bounds-checked dynamic array.

📚 Resources

First real contact with the STL: sequence containers, iterators and the standard algorithms that operate on them. Covers writing templates that accept any container, and extending std::stack so its underlying container becomes iterable.

📚 Resources

Three standalone programs, each restricted to a different container, with strict input parsing and validation: a Bitcoin price evaluator built on std::map, an RPN calculator built on std::stack, and a Ford-Johnson merge-insertion sort benchmarked across std::vector and std::deque.

📚 Resources

📝 Notes

  • 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)

👨‍💻 Author

Abdellahsyani

📄 License

This project is created for educational purposes.

🤝 Contributing

This is a personal learning repository, but feel free to open issues if you spot any problems or have suggestions!


Happy Coding! 🚀

About

This repo is about learning oop by using cpp language

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages