Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A collection of C++ programs demonstrating core Object-Oriented Programming (OOP) concepts — from classes and constructors to inheritance, polymorphism, and templates. Perfect for beginners learning C++ OOP through hands-on examples.

Notifications You must be signed in to change notification settings

Mansiikumarii/OOP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎯 OOP in C++ — A Hands-On Exploration

Welcome to Mansiikumarii/OOP, a practical deep dive into the world of Object-Oriented Programming (OOP) using C++!
This repository is a complete collection of examples demonstrating key OOP concepts — from the basics of classes and objects to advanced topics like inheritance, polymorphism, and templates.


🌟 What's Inside

Each .cpp file in this repository focuses on a specific OOP concept with simple, easy-to-understand code examples and corresponding executables (.exe).

Category Files Included Description
🧱 Basics of Classes & Objects Objects.cpp, MultipleObjects.cpp, MethodInside.cpp, MethodOutside.cpp Learn how to define and use classes, methods, and objects.
🏗️ Constructors Constructor.cpp, ConstructorOverloading.cpp, DefaultConstructor.cpp, ParametrisedConstructor.cpp, ConstructorDefinedOutsideClass.cpp Understand constructors, overloading, and object initialization.
🔒 Access Control & Friend Functions AccessPrivate.cpp, FriendFunctions.cpp Learn about access specifiers (private, public, protected) and friend functions.
🧬 Inheritance Inheritance.cpp, InheritanceAccess.cpp, MultilevelInheritance.cpp, MultipleInheritance.cpp Explore code reuse, hierarchy, and different inheritance types.
🧠 Polymorphism & Virtual Functions Polymorphism.cpp, WithVirtualFunction.cpp, WithoutVirtualFunction.cpp, StaticDynamic.cpp Discover how runtime and compile-time polymorphism work.
🧩 Templates Templates.cpp Get started with generic programming using templates.
⚙️ Miscellaneous Demos Dynamic.exe, hero.cpp, intro.cpp Additional examples showcasing C++ flexibility and creativity.

🧰 Technologies Used

  • Language: C++
  • Compiler: g++ / MinGW / Visual Studio C++ Compiler
  • Paradigm: Object-Oriented Programming

🚀 How to Run

🖥️ Using Command Line

# Clone the repository
git clone https://github.com/Mansiikumarii/OOP.git

# Navigate to the folder
cd OOP

# Compile any example
g++ ConstructorOverloading.cpp -o ConstructorOverloading.exe

# Run the program
./ConstructorOverloading.exe

💡 Using an IDE

You can also open these files in Code::Blocks, Visual Studio, or Dev-C++, and run them directly.


🎓 Learning Outcomes

By exploring this repository, you’ll gain a strong understanding of:

  • Class and object design
  • Data encapsulation and abstraction
  • Inheritance hierarchy and access control
  • Polymorphism and virtual functions
  • Constructor and destructor behavior
  • Template usage for generic programming

🌈 Why This Repo?

“Tell me and I forget. Teach me and I remember. Involve me and I learn.” — Benjamin Franklin

This repository is built to learn by doing — every concept is explained through working examples to make C++ OOP clear, fun, and practical.


💬 Passionate about C++ and exploring the beauty of object-oriented design.

GitHub


🪄 Contribute

Feel free to:

  • 🌟 Star this repository
  • 🐛 Open issues if you find bugs
  • 🔧 Submit pull requests with improvements or new examples

Let’s learn and build together!


🚀 “Code is like humor. When you have to explain it, it’s bad — so let’s make code that speaks for itself!”

About

A collection of C++ programs demonstrating core Object-Oriented Programming (OOP) concepts — from classes and constructors to inheritance, polymorphism, and templates. Perfect for beginners learning C++ OOP through hands-on examples.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages