This is a simple C++ program that demonstrates the use of classes, pointers, and dynamic memory allocation. The program allows the user to input and display the names of multiple persons using an array of object pointers.
π Features
Create a Person class Take input for multiple persons Store objects dynamically using pointers Display stored data Demonstrates basic Object-Oriented Programming (OOP) concepts
π§ Concepts Used
Classes and Objects Pointers Dynamic Memory Allocation (new) Arrays of Pointers Member Functions
Save the file as main.cpp Compile the program: Bash g++ main.cpp -o program Run the program: Bash ./program
π· Sample Output
Enter the name of Person : Ali
Enter the name of Person : Ahmed
Enter the name of Person : Sara
Enter the name of Person : Zain
Enter the name of Person : Mateen
The name of the person is : Ali
The name of the person is : Ahmed
The name of the person is : Sara
The name of the person is : Zain
The name of the person is : Mateen
π Author
Muhammad Mateen