Skip to content

reshma-dev37/cpp-oops-practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cpp-oops-practice

This repository contains solutions to OOPS-based coding questions.

Topics covered: 1.Classes & Objects 2.Constructor and destructor. 3. Inheritance 4.Abstraction 5.Polymorphism 6.Operator overloading. 7. Virtual functions.

A constructor is a special member function of a class that is automatically invoked when an object is created.
It is mainly used to initialize object members. A destructor is a special member function that is automatically invoked when an object goes out of scope or is destroyed.
It is used to free allocated memory and perform cleanup operations.

Types of Constructors

  1. Default Constructor
  • Does not accept parameters.
  • Used to set default values for object members.
  1. Parameterized Constructor
  • Accepts parameters.
  • Used to initialize member variables with given values.
  1. Copy Constructor
  • Used to create a new object from an existing object of the same class.
  1. Copy Assignment Operator
  • Used to copy data from one already-existing object to another existing object.
  1. Move Constructor
  • Transfers ownership of resources from one object to another.
  1. Move Assignment Operator
  • Transfers ownership from one existing object to another existing object.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages