Skip to content

Hands-on practice of core Object-Oriented Programming (OOP) concepts in C++, demonstrating classes, inheritance, polymorphism, and other fundamentals through practical examples.

License

Notifications You must be signed in to change notification settings

sehrishjaved19/OOP_cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

🖥️ OOP_cpp Repository

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.


🚀 About This Repository

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.


🧭 Table of Contents

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.

🗂️ Folder Structure


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


🧠 Learning Objectives

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.

💡 How to Use This Repository

  1. Clone or Download the repository:

    git clone https://github.com/sehrishjaved19/OOP_cpp.git
  2. Open in VS Code or any C++ IDE.

  3. Navigate to the desired section (e.g., 01_introduction/).

  4. Compile and run each .cpp file using g++:

    g++ filename.cpp -o output
    ./output
  5. Practice with exercises provided in the subfolders.


🧩 Requirements

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

🤝 Contributing

Contributions are welcome! If you’d like to add more examples, fix code, or improve documentation:

  1. Fork this repository
  2. Create your feature branch (git checkout -b feature-name)
  3. Commit your changes (git commit -m "Added new example")
  4. Push to the branch (git push origin feature-name)
  5. Open a Pull Request

📜 License

This repository is licensed under the MIT License — see the LICENSE file for details.


💬 Connect

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


About

Hands-on practice of core Object-Oriented Programming (OOP) concepts in C++, demonstrating classes, inheritance, polymorphism, and other fundamentals through practical examples.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages