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%

Course Introduction: OOP with C++

Lesson 1 of 22 in the free Object Oriented Programming with C++ notes on Siksha Sarovar, written by Rohit Jangra.

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.