Managing student records efficiently is a key requirement in educational institutions. A Simple free Student Management System in C++ program helps organize student information by storing, retrieving, updating, and deleting it. In this blog, we will explore how to build a basic Student Database Management System in C++ using Object-Oriented Programming (OOP).

Why Use OOP for Student Enrollment Management System?
Object-Oriented programming OOPs allows us to structure our code modularly by grouping related data and operations into classes and objects. Instead of handling multiple variables separately, we can define a Student class that encapsulates all relevant information, making the program easy to manage and scale.
Core Concepts Used in the Program
- Encapsulation – Student details (roll number, name, section, and department) are bundled together in a single class.
- Abstraction – The user interacts with a simple menu while complex operations are handled internally.
- Arrays of Objects – Instead of using multiple variables, an array of student objects is used to store records efficiently.
Features of the Student Management System in C++

This program provides the following functionalities:
- Insert Student Records: Allows users to enter new student details.
- Search Student Records: Fetches and displays information based on roll number.
- Display All Records: Lists all stored student records.
- Delete a Student Record: Removes a student’s data permanently.
- Update Student Information: Modifies section or department details.
How the Program Works
The system operates through a menu-driven approach, allowing users to choose an option and perform the corresponding action. The program continues to run until the user decides to exit.
Step 1: Storing Student Details

When a student record is inserted, their roll number, name, section, and department are taken as input and stored in an array. Each new entry increases the total count of students in the system.
Step 2: Searching for a Student

The system allows users to search for a student using their roll number. If found, the student’s details are displayed. If not, an appropriate message is shown.
Step 3: Displaying All Records
All student records can be viewed at once, formatted in a table structure for clarity.
Step 4: Deleting a Student Record
When a student’s record is deleted, the remaining records are shifted to fill the gap, ensuring no empty spaces exist in the array.
Step 5: Updating a Student’s Information
Users can modify a student’s section, department, or both, making the system dynamic and adaptable.
Student Management System in C++: Source Code
#include<iostream> #include<stdlib.h> using namespace std; class STUDENT { int STU_ROLL; char STU_NAME[20]; char STU_SEC[20]; char STU_DEPT[20]; public: int Insert(STUDENT *p,int n) { cout<<"Enter ROll: "; cin>>p[n].STU_ROLL; cout<<"Enter Name: "; cin>> p[n].STU_NAME; cout<< "Enter SECTION: "; cin>> p[n].STU_SEC; cout<<"Enter DEPT: "; cin>> p[n].STU_DEPT; cout<<"\nRECORD INSERTED...\n"; n++; return n; } void Search(STUDENT *p,int roll,int n) { int i=0; for( i=0;i<n;i++) { if(p[i].STU_ROLL==roll) { cout<<"ROLL\tNAME\tSEC\tDEPT\n==============================================\n"; cout<<STU_ROLL<<"\t"<<STU_NAME<<"\t"<<STU_SEC<<"\t"<<STU_DEPT<<"\n"; break; } } if(p[i].STU_ROLL!=roll) { cout<<"\nRECORD NOT FOUND.\n"; } } void Display(){ cout<<STU_ROLL<<"\t"<<STU_NAME<<"\t"<<STU_SEC<<"\t"<<STU_DEPT<<"\n"; } int Del(STUDENT *p,int n,int roll) { int j=0,k,flag=0; for(j=0;j<n;j++) { if(p[j].STU_ROLL==roll) { flag=1; break; } } if(flag==1) { for(k=j;k<n;k++) { p[k]=p[k+1]; } cout<<"\nRECORD DELETED.\n"; return n-1; } else { cout<<"\nRecord Not Found\n"; return n; } } int Update(STUDENT *p,int roll,int n) { int i,ch1; for(i=0;i<n;i++) { if(p[i].STU_ROLL==roll) { while(1){ cout<<"\n!!===OPTIONS IN UPDATE===!!\n"; cout<<"\n 1. Update Section"; cout<<"\n 2. Update Deptarment"; cout<<"\n 3. Update Both"; cout<<"\n 4. Return to main Menu"; cout<<"\n\n Enter Your Choice:"; cin>>ch1; switch(ch1){ case 1: cout<<"Section:"; cin>>p[i].STU_SEC; cout<<"Record Updated...\n"; break; case 2: cout<<"DEPT:\t"; cin>>p[i].STU_DEPT; cout<<"Record Updated...\n"; break; case 3: cout<<"Section:"; cin>>p[i].STU_SEC; cout<<"DEPT:\t"; cin>>p[i].STU_DEPT; cout<<"Record Updated...\n"; break; case 4: return n; default: cout<<"!! Wrong Key !!"; break; } } break; } } if(p[i].STU_ROLL!=roll) { cout<<"\nRecord Not Found\n\n"; } } }; int main() { STUDENT o[10]; int i=0,ch,j,roll; while(1) { cout<<"\n!!===STUDENT MANAGMENT SYSTEM===!!"; cout<<"\n"; cout<< "\n 1.INSERT"; cout<< "\n 2.SEARCH"; cout<< "\n 3.DISPLAY"; cout<< "\n 4.DELETE"; cout<< "\n 5.UPDATE"; cout<< "\n 6.EXIT"; cout<< "\n\n ENTER YOUR CHOICE:"; cin>> ch; switch(ch){ case 1: i=o[0].Insert(o,i); break; case 3: cout<<"ROLL\tNAME\tSEC\tDEPT\n==============================================\n"; for(j=0;j<i;j++){ o[j].Display(); } break; case 2: cout<<"Enter the ROLL for Search:"; cin>> roll; o[0].Search(o,roll,i); break; case 4: cout<<"Enter the ROLL to Delete:"; cin>> roll; i=o[0].Del(o,i,roll); break; case 5: cout<<"Enter the ROLL For Data Update:"; cin>> roll; i=o[0].Update(o,roll,i); break; default: cout<<"Wrong Key!!"; break; case 6: exit(0); } } }
Conclusion
This Simple Student Management System in C++ demonstrates the power of Object-Oriented Programming in handling structured data efficiently. By using encapsulation, abstraction, and arrays of objects, we can create a scalable and maintainable system. This project is a great starting point for learning OOP in C++ and can be expanded further with additional features like data persistence and real-time updates.
Thanks for visiting codehelping.com, for more such coding projects visit here.