From b93c1521f32eb045a5fecb6c9e0a453b6fd98894 Mon Sep 17 00:00:00 2001 From: jopierron Date: Tue, 22 Mar 2022 15:17:04 +0000 Subject: [PATCH] Update Contact.cpp --- src/Contact.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Contact.cpp b/src/Contact.cpp index 0ae36c3..2cced8f 100644 --- a/src/Contact.cpp +++ b/src/Contact.cpp @@ -14,8 +14,8 @@ Contact::Contact(const Personne& Proprietaire): Proprietaire{Proprietaire} { bool Contact::ajouterContact(const Personne& unContact){ if(lesContacts.empty()){ - lesContacts.push_back(&unContact); cout << "Contact ajouté " << unContact <<"\n"; + lesContacts.push_back(&unContact); return true; } if(unContact==Proprietaire) @@ -24,14 +24,15 @@ bool Contact::ajouterContact(const Personne& unContact){ return false; } list::iterator it = find(lesContacts.begin(), lesContacts.end(), &unContact); - if(it!=lesContacts.end()) - cout << " Contact trouvé : " << *it << "\n"; - else - cout << "Erreur : Contact pas trouvé\n"; - // rechercher(unContact); - lesContacts.push_back(&unContact); - // for(int i=0;i