1-list.cpp
#include <iostream>
#include <list>
#include <string.h>
using namespace std;
class Student
{
private:
int id;
char name[32];
public:
Student(){
}
Student(int i, const char *n);
void show();
bool operator==(const Student &s);
};
Student::Student(int i, const char *n)
{
id = i;
strcpy(name, n);
}
void Student::show()
{
cout << "id : " << id << " name : " << name << endl;
}
bool Student::operator==(const Student &s)
{
if (this->id == s.id && strcmp(this->name, s.name) == 0)
{
return true;
}
else
{
return false;
}
}
int main()
{
Student s1(1, "aaa");
Student s2