Delete a student at a class student

how i do delete a student at following class ?

line 63 - 71 :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#include <iostream>
#include <cstring>
using namespace std;
class Date{
    friend class student;
    private: int y, m, d;
   public:
    void assign(int y1, int m1, int d1){
             y = y1;
            if (m1 > 0 && m1 < 13) m = m1;
            else m = 1;
            d = d1;}
            Date(int y1=1390){y = y1; m = 1; d = 1; }
            Date(int y1, int m1){y = y1; m = m1; d = 1; }
            void print (void);

};

void Date::print (){cout << y << '/' << m << '/' << d;}
//---------------------
// studentdent
//---------------------
class student {
    int ID;
   char name[20];
   Date bd;

  public:
   void assign(int id1, char name1[], int y1, int m1, int d1){
       ID = id1;
      strcpy(name, name1);
      bd.assign(y1, m1, d1);
      bd.y = y1;
    }
   void print (){
       cout << endl << "ID: " << ID << " name: " << name << " birthday: ";
      bd.print();
   }
   student();
   int getID(){return ID;}
};
//------------------------

student::student(){
       ID = -1;
      strcpy(name, "");

}
//--------------------
//      Lessson Group
//--------------------
class Group {
  student ourclass[50];
  int stno;
  public:
        Group(){stno = 0;}
     void Register();
     void search();
     void print();
     void del();
};
//----------------
void Group::del()
{
    cout << "plz enter stno : \n";
    int x ;
    cin >> x ;
    for (int i = 0; i < stno; i++)
    if (x == ourclass[i].???)
        ourclass[i] = -1 ;
}

void Group::Register(){
         if (stno > 49) {cout << "full!"; return;}
         char n[20];
         int year,month,day;
         int id1;
         cout << "\nplz enter your name :";
         cin.ignore();
         cin.getline( n, 100);
         cout << "\nplz enter stno:";
         cin >> id1;
         cout << "enter bd :" << endl;
         cout << "year :"  ;
         cin>>year;
         cout << "month :"  ;
         cin>>month;
         cout << "day :"  ;
         cin>>day;
         ourclass[stno].assign(id1, n, year, month, day);
         stno++;
}

void Group::search(){
    cout<< "plz enter number : : \n" ;
             int x; cin >> x;
             for (int i = 0; i < stno; i++)
             if (x == ourclass[i].getID())
                ourclass[i].print();
}
void Group::print(){
    for (int i = 0; i < stno; i++)
        ourclass[i].print();
}
//------------------
int main(){
       
      cout  <<" plz enter number :" << endl ;
    int a;
   Group Object;
    while(1){
       cout << endl;
       cout << "1. register . \n";
       cout << "2. search . \n";
       cout << "3. list .\n";
       cout << "4. Delete \n" ;
       cout << "5. Exit\n";
       
       cin >> a;
       switch(a){
          case 1: Object.Register(); break;;
          case 2: Object.search(); break;
          case 3: Object.print(); break;
          case 4: Object.del();
          case 5: return 0;
          
       }
    }
   cin.get();
}

Topic archived. No new replies allowed.