Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. void Roster::remove(string studentID) {
  2.  
  3.     bool toRemove = false;
  4.  
  5.     for (int i = 0; i < 5; i++) {
  6.  
  7.         if (classRosterArray[i] != NULL && studentID == classRosterArray[i] -> getStudentID()) {
  8.  
  9.                 classRosterArray[i] = nullptr;
  10.                 toRemove = true;
  11.                 break;
  12.  
  13.             }
  14.  
  15.         }
  16.  
  17.  
  18.  
  19.     if (!toRemove) {
  20.  
  21.         cout << "Student: " << studentID << " not found." << endl;
  22.  
  23.     }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement