Welcome! This repository is a comprehensive collection of C++ code examples and practice problems focused on Object-Oriented Programming (OOP) concepts.
The repository contains lecture-wise .cpp
files covering the following topics:
Lecture | Topic |
---|---|
01 | Object Oriented Programming in C++ |
02 | Nesting of Member Functions in C++ |
03 | CPP Object Memory Allocation & using Arrays in Classes |
04 | Static Data Members and Static Member Methods in C++ |
05 | Array of Objects in CPP |
06 | Friend Functions in C++ |
07 | Member Friend Functions in C++ |
08 | More on C++ Friend Functions (Examples & Explanation) |
09 | Constructors In C++ |
10 | Parameterized and Default Constructors In C++ |
11 | Constructor Overloading In C++ |
12 | Constructors With Default Arguments In C++ |
13 | Dynamic Initialization of Objects Using Constructors |
14 | Copy Constructor in C++ |
15 | Destructor in C++ |
16 | Inheritance & Its Different Types with Examples in C++ |
17 | Inheritance Syntax & Visibility Mode in C++ |
18 | Single Inheritance Deep Dive: Examples + Code |
19 | Protected Access Modifier in C++ |
20 | Multilevel Inheritance Deep Dive with Code Example in C++ |
21 | Multiple Inheritance Deep Dive with Code Example in C++ |
22 | Exercise on C++ Inheritance |
23 | Ambiguity Resolution in Inheritance in C++ |
24 | Virtual Base Class in C++ |
25 | Code Example Demonstrating Virtual Base Class in C++ |
26 | Constructors in Derived Class in C++ |
27 | Solution to Exercise on Cpp Inheritance |
28 | Code Example: Constructors in Derived Class in Cpp |
29 | Initialization list in Constructors in Cpp |
30 | Revisiting Pointers: new and delete Keywords in CPP |
31 | Pointers to Objects and Arrow Operator in CPP |
32 | Array of Objects Using Pointers in C++ |
33 | this Pointer in C++ |
34 | Polymorphism in C++ |
35 | Pointers to Derived Classes in C++ |
36 | Virtual Functions in C++ |
37 | Virtual Functions Example and Creation Rules in C++ |
38 | Abstract Base Class & Pure Virtual Functions in C++ |
39 | File I/O in C++: Working with Files |
40 | File I/O in C++: Reading and Writing Files |
41 | File I/O in C++: Read/Write in the Same Program & Closing Files |
42 | File I/O in C++: open() and eof() functions |
43 | C++ Templates: Must for Competitive Programming |
44 | Writing our First C++ Template in VS Code |
45 | C++ Templates: Templates with Multiple Parameters |
46 | C++ Templates: Class Templates with Default Parameters |
47 | C++ Function Templates & Function Templates with Parameters |
48 | Member Function Templates & Overloading Template Functions in C++ |
49 | The C++ Standard Template Library (STL) |
50 | Containers in C++ STL |
51 | Vector In C++ STL |
52 | List In C++ STL |
53 | Map In C++ STL |
54 | Function Objects (Functors) In C++ STL |
The PRACTICE/
folder contains additional C++ files for hands-on practice. Below is a list of all practice files:
File Name | Description |
---|---|
01_LinkedList.c++ | Linked List implementation |
02Con_And_Des.cpp | Constructors and Destructors |
03_Multi_Level_Inheritance.cpp | Multilevel Inheritance |
04_Single_Inheritance.cpp | Single Inheritance |
05_Multiple_Inheritance.cpp | Multiple Inheritance |
06_Multipath_Inheritance.cpp | Multipath Inheritance |
07_Hierarchial_Inheritance.cpp | Hierarchical Inheritance |
08_Hybrid_Inheritance.cpp | Hybrid Inheritance |
09_Function_Template.cpp | Function Templates |
10_Class_Template.cpp | Class Templates |
11_Simple_Exception.cpp | Simple Exception Handling |
12_Multiple_Exception.cpp | Multiple Exception Handling |
13_Custom_Exception.cpp | Custom Exception Handling |
14_Find_Function.cpp | STL find function |
15_Count_Function.cpp | STL count function |
16_Sort_Function.cpp | STL sort function |
17_Search_Function.cpp | STL search function |
18_For_Each_Statement.cpp | STL for_each statement |
19_Transform_Method.cpp | STL transform method |
20_Lists.cpp | STL lists |
21_Deque.cpp | STL deque |
22_autoStorageClass.cpp | auto Storage Class |
23_RegisterStorageClass.cpp | register Storage Class |
24_staticStorageClass.cpp | static Storage Class |
25_externStorageClass.cpp | extern Storage Class |
26_mutableStorageClass.cpp | mutable Storage Class |
27_namedIdiom.cpp | Named Idiom example |
OOPs-With-CPP/
│
├── 00_Contents.txt # List of all lecture topics
├── 01_Object_Oriented_Programming_in_Cpp.cpp
├── 02_Nesting_of_Member_Functions_in_Cpp.cpp
├── ... (other lecture .cpp files)
├── PRACTICE/ # Folder with extra practice codes
│ ├── 01_LinkedList.c++
│ ├── 02_Con_And_Des_.cpp
│ └── ...
└── README.md
git clone https://github.com/avinashyadav16/OOPs-With-CPP.git
cd OOPs-With-CPP
Open any .cpp
file in your favorite IDE or editor and compile/run as needed.
Contributions are welcome! Feel free to fork the repo, add new examples or practice problems, and submit a pull request.
Happy Coding! 👨💻 Happy Learning! 🚀