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%

2.0 Unit 2 Overview: Classes, Objects, Constructors & Destructors

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

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 — declaration, access specifiers, member functions
  2. Arrays within a class + array of objects
  3. Memory allocation of objects
  4. Passing objects as arguments + returning objects from functions
  5. Function overloading (recap with class methods)
  6. Static data and member functions
  7. Friend function and friend class
  8. this pointer
  9. Constructors — default, parameterized, with default arguments, multiple, copy
  10. Destructors

Learning outcomes

After Unit II you should be able to:

  • Declare classes with proper access specifiers
  • Distinguish public/private/protected
  • Write constructors (default, parameterized, copy) and destructors
  • Explain when each special member function is invoked
  • Use this pointer
  • Declare friend functions and friend classes
  • Distinguish static vs non-static members

Topic map

Chapter mapping (IPU)

  • TB1 (Venugopal): Chapters 10, 11
  • TB2 (Balagurusamy): Chapters 5, 6

Typical exam weight

Unit II contributes 2 long questions + frequent short answers:

  • What is a class? Differentiate class and structure. — short
  • Explain access specifiers with example. — 12.5 marks
  • Explain constructors. Types of constructors with example. — 12.5 marks (very high)
  • What is a copy constructor? When is it called? — 12.5 marks
  • What is the this pointer? Explain with example. — short
  • Differentiate friend function and member function. — short