From: Lukas Jiriste Date: Thu, 24 Oct 2024 11:32:29 +0000 (+0200) Subject: Leave number out of SEARCH, add SEARCH header X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=refs%2Fheads%2Ftrunk;p=42%2FCPP_Module_00 Leave number out of SEARCH, add SEARCH header --- diff --git a/ex01/contact.cpp b/ex01/contact.cpp index a4f308f..d5bca30 100644 --- a/ex01/contact.cpp +++ b/ex01/contact.cpp @@ -40,7 +40,6 @@ void Contact::short_print(size_t index) print_field(m_first_name); print_field(m_last_name); print_field(m_nickname); - print_field(m_number); std::cout << '\n'; } diff --git a/ex01/phone_book.cpp b/ex01/phone_book.cpp index 38bca8d..c102e2f 100644 --- a/ex01/phone_book.cpp +++ b/ex01/phone_book.cpp @@ -2,6 +2,7 @@ #include #include #include +#include PhoneBook::PhoneBook(void): m_size(0), m_last_added(7) @@ -76,6 +77,10 @@ void PhoneBook::search(void) std::cout << "There are no contacts to be shown yet.\n"; return ; } + std::cout << '|' << std::setw(10) << "Index" << "|"; + std::cout << std::setw(10) << "First name" << "|"; + std::cout << std::setw(10) << "Last name" << "|"; + std::cout << std::setw(10) << "Nickname" << "|\n"; for (size_t i = m_size; i > 0; --i) m_contacts[(i + m_last_added) % m_size].short_print(m_size - i + 1); while (true)