Welcome to my C++ Programs Repository!
This repository contains all the assignments and practice programs I’ve completed as part of my learning journey in Computer Engineering.
📘 Each assignment is organized and documented with a short description and a direct link to the source code.
This is meant to serve as a reference for students, beginners, and anyone learning C++ programming.
Implementation of a
person
class to demonstrate classes, objects, default constructors, and parameterized constructors.
A program demonstrating an alternative way to initialize object data using a public member function (
ScanData
) instead of a constructor.
Implementation of a
person
class to demonstrate classes, objects, default constructors, and parameterized constructors.
Demonstrates the OOP principle of encapsulation using a
Person
class with public getter and setter methods to access and modify private data.
Enhances the
Person
class by adding input validation logic within constructors and setter methods to ensure data integrity.
A program demonstrating how to manage dynamic memory within a class using
new
in constructors anddelete
/delete[]
in a destructor to prevent memory leaks.
An
Employee
class that uses getters and setters for dynamically allocated data, showing how to correctly deallocate and reallocate memory in a setter to prevent memory leaks.
Illustrates the critical difference between a default shallow copy and a manual deep copy. This is crucial when a class contains pointers to dynamically allocated memory to prevent runtime errors like dangling pointers and double-free exceptions.
A comprehensive example demonstrating single, multilevel, and hierarchical inheritance. It builds a class hierarchy from
Person
toDeveloper
and its subtypes, also showing the use ofprotected
members and constructor chaining.