NotesB.Sc ITOOPs using C++
BSIT203/BSBC203

OOPs using C++ Notes

Program:B.Sc IT
Semester:Semester 2
Credits:5
Units:4 Units

Subject Overview

OOPs using C++ moves students from procedural C into object-oriented C++ — classes and class declaration, constructors/destructors and member function definitions, inheritance and function/operator overloading, and polymorphism and file I/O. A 5-credit core theory paper.

Unit-wise Syllabus

4 units — open any unit for detailed topic-wise notes, diagrams and important exam questions

  • Object-oriented programming approach
  • characteristics of OOP languages
  • bridging C and C++
  • structures and unions in C++
  • class declaration — data members
  • member functions
  • private/public members
  • data hiding and encapsulation
ClassificationFour pillars of OOP
Object-oriented programming
  • Encapsulation

    Data and functions bundled in a class

  • Abstraction

    Show what, hide how

  • Inheritance

    Reuse a base class

  • Polymorphism

    One interface, many forms

Study guide

This unit introduces the OOP approach: its characteristics, bridging from C to C++, structures and unions in C++, class declaration with data members and member functions, private and public members and data hiding and encapsulation. Model a real object such as a bank account as a class.

Read Unit 1 notes
  • Member function definitions inside/outside the class
  • friend functions
  • inline functions
  • static members and functions
  • scope resolution operator
  • creating and accessing objects
  • arrays of objects
  • pass by value/reference
  • default/parameterized/copy constructors
  • destructors
ComparisonTypes of constructors
Purpose
Example

Default

Creates an object with no arguments

Student s;

Parameterised

Initialises with given values

Student s(1, "Ana");

Copy

Creates a copy of another object

Student t(s);

Destructor

Cleans up when the object is destroyed

~Student()

Study guide

You study member functions inside and outside the class, friend, inline and static functions, the scope resolution operator, creating and accessing objects, arrays of objects, passing objects by value and reference, default, parameterised and copy constructors and destructors. Trace the order of constructor and destructor calls.

Read Unit 2 notes
  • Base and derived classes
  • visibility modes (private/public/protected)
  • single and multilevel inheritance
  • protected member inheritance
  • nesting of classes
  • function and operator overloading (unary and binary)
ComparisonInheritance visibility modes
Base public members become
Base protected members become

public inheritance

public

protected

protected inheritance

protected

protected

private inheritance

private

private

Study guide

You study base and derived classes, visibility modes, single and multilevel inheritance, protected members, nested classes and function and operator overloading. Draw an inheritance diagram for each program you write.

Read Unit 3 notes
  • Early and late binding
  • virtual functions and pure virtual functions
  • streams/buffers/iostreams
  • header files
  • file input and output
ComparisonEarly vs late binding
Early (static) binding
Late (dynamic) binding

Decided at

Compile time

Run time

Achieved by

Function and operator overloading

Virtual functions

Speed

Faster

Slightly slower

Flexibility

Less

More

Study guide

You study early and late binding, virtual and pure virtual functions, streams, buffers and iostreams and file input and output. Understand how a virtual function enables runtime polymorphism.

Read Unit 4 notes

Why OOPs using C++ Matters

Object-oriented design is how most modern software is structured, and C++ OOP carries over to Java, Python and C#. OOP questions are a staple of technical interviews.

How to Prepare for OOPs using C++

  • Code every concept: constructors, inheritance, overloading and virtual functions.
  • Know the difference between overloading and overriding.
  • Practise explaining OOP with real-life examples.

OOPs using C++: Frequently Asked Questions

What is encapsulation?

Encapsulation bundles data and the functions that operate on it into a single class and restricts direct access to the data.

What is a virtual function?

A virtual function is a member function that can be overridden in a derived class and is resolved at run time based on the actual object type.

Want the Complete Notes & Past Papers?

WhatsApp us and we'll send you the full notes, question banks, and previous year papers for OOPs using C++.