From 7bc9220a7af4d7e7a1ac5e225ca69284919ea031 Mon Sep 17 00:00:00 2001 From: Camille Chauvet Date: Mon, 22 May 2023 17:08:28 +0000 Subject: [PATCH] fix: search() call the destructor of phone_book --- ex01/src/main.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ex01/src/main.cpp b/ex01/src/main.cpp index 9072da9..6be9bcc 100644 --- a/ex01/src/main.cpp +++ b/ex01/src/main.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include "../include/PhoneBook.hpp" @@ -34,10 +35,9 @@ Contact* read_contact() return (NULL); return (new Contact(first_name, last_name, nickname, phone_number, darkest_secret)); - } -Contact* search(PhoneBook phone_book) +Contact* search(PhoneBook &phone_book) { int index; std::string index_str; @@ -60,7 +60,6 @@ int main() Contact* contact; PhoneBook phone_book; - phone_book = PhoneBook(); while (true) { std::cout << "command: ";