Voila je cherche depuis quelques jours mais je ne trouve pas la solution. Ce code me renvoie un message "Erreur de segmentation (core dumped)" et j'aimerais savoir si quelqu'un connait la solution?

cpersonne.hpp:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class CPersonne{
	private:
	string *nom, *prenom, *id, *mail;
	public:
		CPersonne();
		CPersonne(string, string, string, string);
		void set_nom(string);
		void set_prenom(string);
		void set_id(string);
		void set_mail(string);
		string get_nom() const;
		string get_prenom() const;
		string get_id() const;
		string get_mail() const;
		friend bool operator ==(CPersonne, CPersonne);
		friend ostream& operator<<(ostream& out,CPersonne p);
		~CPersonne();
};
cpersonne.cpp:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
CPersonne::CPersonne(){
	this->nom = new string;
	this->prenom = new string;
	this->id = new string;
	this->mail = new string;
}
 
CPersonne::CPersonne(string nom, string prenom, string id, string mail){
	 this->nom = new string(nom);
	 this->prenom = new string(prenom);
	 this->id = new string(id);
	 this->mail = new string(mail);
 }
 
 void CPersonne::set_nom(string nom){
	 this->nom = new string(nom);
 }
 
void CPersonne::set_prenom(string prenom){
	this->prenom = new string(prenom);
}
 
void CPersonne::set_id(string id){
	this->id = new string(id);
}
 
void CPersonne::set_mail(string mail){
	this->mail = new string(mail);
}
 
string CPersonne::get_nom() const{
	return *(this->nom);
}
 
string CPersonne::get_prenom() const{
	return *(this->prenom);
}
 
string CPersonne::get_id() const{
	return *(this->id);
}
 
string CPersonne::get_mail() const{
	return *(this->mail);
}
 
bool operator ==(CPersonne p1, CPersonne p2){
	return (p1.get_id() == p2.get_id());
}
 
ostream& operator<<(ostream& out,CPersonne p){
	return out<<p.get_nom()<<", "<<p.get_prenom()<<", "<<p.get_id()<<", "<<p.get_mail()<<"."<<endl;
}
 
CPersonne::~CPersonne(){
	delete nom;
	delete prenom;
	delete id;
	delete mail;
}
main.cpp:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
int main(int argc, char const* argv[]){
	CPersonne p1 ("Lau", "Cédric", "1", "xxxx");
	CPersonne p2 ("Cou", "Patrick", "1", "xxx");
	if(p1 == p2){
		cout<<"C'est bon."<<endl;
	}
	cout<<p1;
}
Merci d'avance si quelqu'un a le temps et la solution à m'apporter!