diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-11-09 11:26:50 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-11-09 11:26:50 +0100 |
| commit | b799c007a1b6911fcbe5141429ea541e1277ebdd (patch) | |
| tree | d70ad0826ad2fc2d635adf9afecf89af0838d20b /cpp00/ex01/main.cpp | |
| parent | 1e9d90bdf9ef5fc05093d3449d883597c7f896de (diff) | |
| download | piscine_cpp-b799c007a1b6911fcbe5141429ea541e1277ebdd.tar.gz piscine_cpp-b799c007a1b6911fcbe5141429ea541e1277ebdd.tar.bz2 piscine_cpp-b799c007a1b6911fcbe5141429ea541e1277ebdd.zip | |
Fixing some edge cases in cpp00 and cpp01, Updated formatting
Diffstat (limited to 'cpp00/ex01/main.cpp')
| -rw-r--r-- | cpp00/ex01/main.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
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 <charles.cabergs@gmail.com> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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 |
