# include <iostream>
# include <stack>
# include <string>
using namespace std;
/*pseudocode to maintain the records of students. The users should be able to
add new student, edit, delete and search information of students*/
class stud{
protected:
string name;
string info;
public:
stud(string _name="", string _info=""){name=_name;info=_info;}
~stud(){name.clear();info.clear();}
void add(string _name, string _info);
void edit(string _name, string _info);
void deletestud();
friend stud* search(stud a [] , int num, string name);
};
stud* search(stud a [] , int num,string name);
void stud::add(string _name, string _info){
name=_name;
info=_info;
}
void stud::edit(string _name, string _info){
name=_name;
info=_info;
}
void stud::deletestud(){
stud::~stud();
}
stud* search(stud a [] , int num,string _name){
while (a){
if (_name == a->name) {return a;}
a++;
}
return nullptr;
}
Comments
Leave a comment