Welcome to the OOP_cpp Repository — a complete, structured journey through C++ Object-Oriented Programming (OOP).
This repository is designed for learners who want to understand OOP concept by concept, with each section containing well-documented C++ files, exercises, and practical examples.
This repository serves as a hands-on C++ OOP learning path, organized into logical sections that build upon each other.
It starts with the basics — classes, objects, and member functions — and gradually advances toward constructors, destructors, inheritance, polymorphism, virtual functions, and advanced OOP concepts.
Each folder includes:
- 🧩 Topic-based C++ programs
- 🧠 Practice exercises to reinforce learning
- 📘 README.md explaining the concepts covered
Whether you’re a student, beginner developer, or self-learner, this repository helps you master C++ OOP through structured practice.
| No. | Topic | Description |
|---|---|---|
| 01 | Introduction | Basics of classes, objects, data members, and user-defined types. |
| 02 | Constructor | Constructors, overloading, copy constructors, and parameterized constructors. |
| 03 | Destructor | Destructors and cleanup of objects. |
| 04 | Operator Overloading | Overloading operators for custom behavior. |
| 05 | Inheritance | Accessing parent members, derived class specification. |
| 06 | Function Overriding | Overriding functions in derived classes. |
| 07 | Types of Inheritance | Multilevel and multiple inheritance, constructors in multiple inheritance. |
| 08 | Polymorphism | Run-time and compile-time polymorphism. |
| 09 | Pointer to Objects | Using pointers with objects. |
| 10 | Pointers and Inheritance | Interaction of pointers with inheritance hierarchy. |
| 11 | Virtual Functions | Virtual functions and dynamic binding. |
| 12 | Early and Late Binding | Differences between early & late binding. |
| 13 | Pure Virtual Function | Abstract classes and pure virtual functions. |
| 14 | Virtual Base Classes | Solving diamond problem using virtual base classes. |
OOP_cpp/
├── 01_introduction/
│ ├── 01_data_member_and_data_function/
│ ├── 02_defining_member_function_outside_class/
│ └── 03_user_defined_data_type/
├── 02_constructor/
│ ├── 01_constructor_introduction/
│ ├── 02_constructor_overloading/
│ ├── 03_default_copy_constructor/
│ └── 04_passing_parameters_to_constructor/
├── 03_destructor/
├── 04_operator_overloading/
├── 05_inheritence/
│ ├── 01_accessing_members_of_parent_class/
│ └── 02_specifying_a_dervied_class/
├── 06_function_overriding/
├── 07_Types_of_inheritence/
│ ├── 01_multilevel_inheritence/
│ └── 02_multiple_inheritence/
│ └── 01_contructors_in_multiple_inheritence/
├── 08_polymorphism/
├── 09_pointer_to_objects/
├── 10_pointers_and_inheritance/
├── 11_virtual_functions/
├── 12_early_and_late_binding/
├── 13_pure_virtual_function/
└── 14_virtual_base_classes/
LICENSE
README.md
CONTRIBUTING.md
CODE_OF_CONDUCT.md
.gitignore
By following this repository, you’ll learn to:
- Understand core C++ syntax and OOP concepts.
- Work with classes, objects, constructors, and destructors.
- Apply inheritance, polymorphism, and virtual functions.
- Overload operators and override functions for custom behavior.
- Manage pointers and references in object-oriented contexts.
- Solve real-world problems using OOP design patterns.
-
Clone or Download the repository:
git clone https://github.com/sehrishjaved19/OOP_cpp.git
-
Open in VS Code or any C++ IDE.
-
Navigate to the desired section (e.g.,
01_introduction/). -
Compile and run each
.cppfile using g++:g++ filename.cpp -o output ./output
-
Practice with exercises provided in the subfolders.
- C++ Compiler (GCC, MinGW, or equivalent)
- A text editor or IDE (VS Code, CLion, Code::Blocks)
- Basic command-line knowledge
Optional:
- Internet connection for reference or external libraries.
Contributions are welcome! If you’d like to add more examples, fix code, or improve documentation:
- Fork this repository
- Create your feature branch (
git checkout -b feature-name) - Commit your changes (
git commit -m "Added new example") - Push to the branch (
git push origin feature-name) - Open a Pull Request
This repository is licensed under the MIT License — see the LICENSE file for details.
Author: Sehrish Javed
GitHub: @sehrishjaved19
LinkedIn: Sehrish Javed
Twitter (X): @Sehrishjaved119
🌟 “Learning C++ OOP is about understanding structure, logic, and design. Build step by step, practice, and write clean, reusable code.”