Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

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)

  1. 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…
  2. 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…
  3. 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…
  4. 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++ --- ---…
  5. 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 -…
  6. 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 --- ---…
  7. 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 —…
  8. 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)…
  9. 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…
  10. 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…
  11. 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…
  12. 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,…
  13. 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…
  14. 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…
  15. 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…
  16. 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…
  17. 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.…
  18. 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…
  19. 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…
  20. 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…
  21. 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…
  22. 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

AspectProcedural (C)Object-Oriented (C++)
DecompositionTop-down — functionsBottom-up — objects
Data + behaviourSeparate (struct + funcs)Encapsulated (class)
ReuseFunction librariesInheritance + composition
Real-world modellingIndirectNatural — entities are objects
MaintainabilityHard at scaleModular, localised changes
ExtensibilityModify existing functionsInherit + 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

PillarDefinitionC++ Mechanism
EncapsulationBundle data + operations; hide internalsclass with private members
AbstractionShow essential features, hide detailsPublic interface + private implementation
InheritanceDerive new classes from existing onesclass B : public A
PolymorphismSame interface, multiple behavioursVirtual 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

UnitThemeKey TopicsHours (IPU)
IOOP Paradigm + C++ basicsOOP concepts, C vs C++, references, functions, new/delete10
IIClasses, Objects, ConstructorsClass declaration, friend, static, this, constructors, destructors11
IIIInheritance, Polymorphism, Operator OverloadingDerivation modes, virtual functions, abstract classes, operator overloading12
IVTemplates, Exceptions, FilesFunction/class templates, exception handling, streams, file I/O11

---

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

  1. Write the code yourself. OOP is not a spectator sport — type every example into the online compiler and run it.
  2. Memorise the pillars first. Encapsulation, abstraction, inheritance, polymorphism — these four words structure every answer.
  3. Master the "this" pointer, virtual functions, and templates. These three concepts separate the top scorers from the rest.
  4. Draw diagrams for inheritance hierarchies. Examiner expects you to show class trees.
  5. 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:

  1. OOP paradigm — procedural vs OOP, four pillars, benefits
  2. C vs C++ — what C++ adds, why migrate
  3. C++ basics — stream I/O, literals, operators, reference variables
  4. Functions in C++ — default arguments, parameter passing (value/reference/pointer), inline functions, type conversion
  5. Memory managementnew and delete operators, 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/delete for 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 / delete and malloc / 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.