Object Oriented Programming with C++ — Free Notes & Tutorial
Free Object Oriented Programming with C++ notes for BCA (GGSIPU IPU) — OOP paradigm, classes, objects, constructors, destructors, inheritance (single/multiple/multilevel/hybrid), virtual functions, abstract classes, operator overloading, function/class templates, exception handling, streams, file I/O, random access. 100% free.
This Object Oriented Programming with C++ course is part of Siksha Sarovar and is 100% free for students in India — no sign-up required to read. It contains 22 structured lessons with examples, and pairs with our free online compiler and AI tutor.
What you will learn
- OOP concepts
- Encapsulation
- Abstraction
- Inheritance
- Polymorphism
- C++ classes
- Constructors
- Destructors
- Virtual functions
- Abstract classes
- Operator overloading
- Function templates
- Class templates
- Exception handling
- Streams
- File I/O
Course content (22 lessons)
- Course Introduction: OOP with C++ — Course Introduction: Object Oriented Programming with C++ C++ is a multi-paradigm, statically-typed, compiled language that adds object-orientation to C. Created by Bjarne…
- 1.0 Unit 1 Overview: OOP Paradigm & C++ Basics — Unit I — Overview: OOP Paradigm & C++ Basics Unit I lays the conceptual and language foundations: 1. OOP paradigm — procedural vs OOP, four pillars, benefits 2. C vs C++ — what…
- 1.1 OOP Paradigm — Procedural vs OOP, Concepts, Benefits — 1.1 OOP Paradigm Procedural Programming — what came before Procedural programming (C, Pascal, FORTRAN) decomposes a problem into a sequence of procedures (functions) . Data and…
- 1.2 C vs C++, Streams, Operators & Reference Variables — 1.2 C vs C++, Streams, Operators & Reference Variables C vs C++ — Comparison C++ is often called "C with classes" — but it's much more. The full comparison: Aspect C C++ --- ---…
- 1.3 Functions in C++ — Default Args, Parameter Passing, Inline — 1.3 Functions in C++ Function Basics — quick recap Example: C++ inherits all C function features and adds: - Default arguments - Function overloading - Reference parameters -…
- 1.4 Dynamic Memory — new, delete, and Allocation for Arrays — 1.4 Dynamic Memory — new, delete, and Allocation for Arrays Memory Model in C++ A C++ program's memory is divided into several regions: Region Stores Lifetime Management --- ---…
- 2.0 Unit 2 Overview: Classes, Objects, Constructors & Destructors — Unit II — Overview: Classes, Objects, Constructors & Destructors Unit II is the core OOP unit — every concept here is fundamental and exam-heavy. 1. Classes & Objects —…
- 2.1 Class Declaration, Access Specifiers & Member Functions — 2.1 Class Declaration, Access Specifiers & Member Functions What is a Class? A class is a user-defined data type that bundles data (data members) and functions (member functions)…
- 2.2 Function Overloading, Static Members, Friend & this Pointer — 2.2 Function Overloading, Static Members, Friend & this Pointer Function Overloading in Classes Already introduced in Unit I — within a class, you can overload constructors and…
- 2.3 Constructors — Default, Parameterized & Multiple — 2.3 Constructors — Default, Parameterized & Multiple What is a Constructor? A constructor is a special member function that is automatically called when an object is created . It…
- 2.4 Copy Constructor & Destructor — 2.4 Copy Constructor & Destructor Copy Constructor A copy constructor creates a new object as a copy of an existing object of the same class. It is invoked automatically in…
- 3.0 Unit 3 Overview: Inheritance, Polymorphism & Operator Overloading — Unit III — Overview: Inheritance, Polymorphism & Operator Overloading Unit III is the largest OOP unit (12 hrs) and contains the highest-impact topics: 1. Inheritance — types,…
- 3.1 Inheritance — Types & Derivation Modes — 3.1 Inheritance — Types & Derivation Modes What is Inheritance? Inheritance is the mechanism by which a new class ( derived class ) acquires the properties and behaviours of an…
- 3.2 Ambiguity Resolution, Virtual Base Class & Ctor/Dtor in Derived — 3.2 Ambiguity Resolution, Virtual Base Class & Ctor/Dtor in Derived Ambiguity in Inheritance Multiple inheritance + name collisions = ambiguity . The compiler can't decide which…
- 3.3 Polymorphism — Virtual Functions, Pure Virtual & Abstract Classes — 3.3 Polymorphism — Virtual Functions, Pure Virtual & Abstract Classes What is Polymorphism? Polymorphism (Greek: "many forms") means the same interface behaves differently for…
- 3.4 Operator Overloading — Unary, Binary & with Friend Functions — 3.4 Operator Overloading — Unary, Binary & with Friend Functions What is Operator Overloading? Operator overloading lets you redefine operator symbols ( + , - , , == , etc.) for…
- 3.5 Type Conversion — Basic to User-Defined and Reverse — 3.5 Type Conversion — Basic to User-Defined and Reverse C++ supports rich type conversion mechanisms. We've seen implicit/explicit conversion between built-in types in Unit I.…
- 4.0 Unit 4 Overview: Templates, Exceptions, Streams & Files — Unit IV — Overview: Templates, Exceptions, Streams & Files Unit IV completes the C++ toolkit with three modern features: 1. Parametric polymorphism / Generic programming via…
- 4.1 Function Templates & Class Templates — 4.1 Function Templates & Class Templates What is Generic Programming? Generic programming writes algorithms and data structures independent of the data type they operate on. The…
- 4.2 Exception Handling — 4.2 Exception Handling Why Exception Handling? Traditional error handling in C uses return codes — every caller must check: Problems: - Forgot to check → silent bug - Polluted…
- 4.3 C++ Streams — Classes, I/O Operations & Manipulators — 4.3 C++ Streams What is a Stream? A stream is an abstraction for a sequence of bytes flowing between a program and a device (keyboard, screen, file, network). C++ I/O is…
- 4.4 File I/O — Modes, Methods, Pointers & Random Access — 4.4 File I/O — Modes, Methods, Pointers & Random Access File I/O in C++ File operations use the <fstream header and three classes: Class Direction Header --- --- --- ofstream…
Course Introduction: OOP with C++
Course Introduction: Object Oriented Programming with C++
C++ is a multi-paradigm, statically-typed, compiled language that adds object-orientation to C. Created by Bjarne Stroustrup at Bell Labs (1979, originally "C with Classes"; renamed C++ in 1983), it powers some of the largest, most performance-sensitive systems in the world — Microsoft Office, Adobe products, Chrome, MySQL, MongoDB, the Unreal/Unity game engines, the LHC's physics simulations, and most high-frequency-trading systems.
This course (IPU BCA) maps to the IPU syllabus and its companion lab paper (C++ Lab). It covers the complete OOP toolkit across four units: language basics + OOP paradigm (Unit I), classes, objects, constructors and destructors (Unit II), inheritance, polymorphism and operator overloading (Unit III), and templates, exception handling, streams and files (Unit IV).
By the end you will be able to design and code real-world systems using inheritance hierarchies, virtual functions, operator overloading, generic templates, exception-safe code, and file I/O.
---
Why OOP Matters
| Aspect | Procedural (C) | Object-Oriented (C++) |
|---|---|---|
| Decomposition | Top-down — functions | Bottom-up — objects |
| Data + behaviour | Separate (struct + funcs) | Encapsulated (class) |
| Reuse | Function libraries | Inheritance + composition |
| Real-world modelling | Indirect | Natural — entities are objects |
| Maintainability | Hard at scale | Modular, localised changes |
| Extensibility | Modify existing functions | Inherit + override |
OOP solves the scalability problem of procedural code: when a system has 100 functions operating on 10 structs, every change ripples everywhere. OOP groups data with the operations that act on it, making changes localised and safe.
---
The Four Pillars of OOP
| Pillar | Definition | C++ Mechanism |
|---|---|---|
| Encapsulation | Bundle data + operations; hide internals | class with private members |
| Abstraction | Show essential features, hide details | Public interface + private implementation |
| Inheritance | Derive new classes from existing ones | class B : public A |
| Polymorphism | Same interface, multiple behaviours | Virtual functions + overloading |
Exam tip: Every OOP question can be answered through these four pillars. Memorise them with one-line definitions and one C++ example each.
---
The Four Units At a Glance
| Unit | Theme | Key Topics | Hours (IPU) |
|---|---|---|---|
| I | OOP Paradigm + C++ basics | OOP concepts, C vs C++, references, functions, new/delete | 10 |
| II | Classes, Objects, Constructors | Class declaration, friend, static, this, constructors, destructors | 11 |
| III | Inheritance, Polymorphism, Operator Overloading | Derivation modes, virtual functions, abstract classes, operator overloading | 12 |
| IV | Templates, Exceptions, Files | Function/class templates, exception handling, streams, file I/O | 11 |
---
Textbooks (IPU Prescribed)
- TB1. K.R. Venugopal, Rajkumar, T. Ravishanker, Mastering C++, TMH
- TB2. E. Balagurusamy, Object Oriented Programming with C++, McGraw-Hill — the IPU classic
- RB1. Ashok N. Kamthane, Object-Oriented Programming with ANSI and Turbo C++, Pearson
- RB2. Herbert Schildt, C++: The Complete Reference, Tata McGraw Hill
- RB3. Robert Lafore, Object Oriented Programming using C++, Galgotia Publications
---
Modern C++ Note
The IPU syllabus is largely C++98 + a touch of C++03 style. Real-world C++ has evolved significantly:
- C++11 (2011) — auto, lambdas, smart pointers, move semantics, range-based for,
nullptr - C++14 (2014) — refinements
- C++17 (2017) —
std::optional, structured bindings,if constexpr - C++20 (2020) — concepts, ranges, coroutines, modules
- C++23 (2023) —
std::expected, more refinements
For exams, stick to the textbook style — but where this course shows alternative modern idioms (e.g. unique_ptr instead of raw new/delete), they are flagged as "modern note."
---
How to Get the Most From This Course
- Write the code yourself. OOP is not a spectator sport — type every example into the online compiler and run it.
- Memorise the pillars first. Encapsulation, abstraction, inheritance, polymorphism — these four words structure every answer.
- Master the "this" pointer, virtual functions, and templates. These three concepts separate the top scorers from the rest.
- Draw diagrams for inheritance hierarchies. Examiner expects you to show class trees.
- Match topics to PYQ patterns — operator overloading + virtual functions + constructors are the three highest-frequency 12.5-mark questions.
Let's begin.
1.0 Unit 1 Overview: OOP Paradigm & C++ Basics
Unit I — Overview: OOP Paradigm & C++ Basics
Unit I lays the conceptual and language foundations:
- OOP paradigm — procedural vs OOP, four pillars, benefits
- C vs C++ — what C++ adds, why migrate
- C++ basics — stream I/O, literals, operators, reference variables
- Functions in C++ — default arguments, parameter passing (value/reference/pointer), inline functions, type conversion
- Memory management —
newanddeleteoperators, dynamic memory allocation for arrays
Learning outcomes
After Unit I you should be able to:
- Differentiate procedural and object-oriented programming
- List the four pillars of OOP with examples
- Identify what C++ adds beyond C
- Write programs using
cin/cout, references, default arguments - Explain inline functions and their use cases
- Use
new/deletefor dynamic memory (including arrays)
Topic map
Chapter mapping (IPU)
- TB1 (Venugopal): Chapters 1, 2
- TB2 (Balagurusamy): Chapters 1, 2, 3
Typical exam weight
Unit I usually contributes 2 long questions:
- Differentiate procedural and object-oriented programming. List benefits of OOP. — 12.5 marks
- Differentiate
new/deleteandmalloc/free. — 12.5 marks - What is a reference variable? How is it different from a pointer? — short answer
- Explain inline functions with example. — short answer
- What are default arguments? Give example. — short answer
Frequently asked questions
Is the Object Oriented Programming with C++ course really free?
Yes. The entire Object Oriented Programming with C++ course on Siksha Sarovar is free to read with no account required. You can optionally sign in with Google to save your progress.
Do I get a certificate for Object Oriented Programming with C++?
Yes — finish the lessons and pass the quiz to earn a free, verifiable certificate you can share on LinkedIn or with recruiters.
Can I run code while learning?
Yes. The built-in online compiler runs C, C++, Python, Java, PHP, JavaScript, C# and SQL directly in your browser — no installation needed.