From aa9df1513d20b5705b1016c1bf68b32d8b78d24e Mon Sep 17 00:00:00 2001 From: Lukas Jiriste Date: Thu, 24 Oct 2024 13:32:29 +0200 Subject: [PATCH] Leave number out of SEARCH, add SEARCH header --- ex01/contact.cpp | 1 - ex01/phone_book.cpp | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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) -- 2.30.2