From b799c007a1b6911fcbe5141429ea541e1277ebdd Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 9 Nov 2020 11:26:50 +0100 Subject: Fixing some edge cases in cpp00 and cpp01, Updated formatting --- cpp00/ex01/main.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'cpp00/ex01/main.cpp') diff --git a/cpp00/ex01/main.cpp b/cpp00/ex01/main.cpp index 5734d38..8b04fe2 100644 --- a/cpp00/ex01/main.cpp +++ b/cpp00/ex01/main.cpp @@ -6,7 +6,7 @@ /* By: charles +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/13 07:23:15 by charles #+# #+# */ -/* Updated: 2020/04/13 09:18:04 by charles ### ########.fr */ +/* Updated: 2020/11/09 09:22:22 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -18,8 +18,7 @@ int main() { std::string input; - PhoneBook phoneBook; - int tmp; + PhoneBook phoneBook; while (true) { @@ -40,7 +39,7 @@ int main() else if (input == "SEARCH") { std::cout << phoneBook << std::flush; - tmp = getInt(); + int tmp = getInt(); if (tmp < 0 || size_t(tmp) >= phoneBook.getSize()) std::cout << "Error: Not valid index: " << tmp << std::endl; else -- cgit