Fixed CTRL+D bug and SHOW to SEARCH command on ex05
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/09/02 21:54:41 by aortigos #+# #+# */
|
||||
/* Updated: 2025/09/06 15:49:04 by aortigos ### ########.fr */
|
||||
/* Updated: 2025/09/07 11:02:47 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -18,14 +18,14 @@ int main()
|
||||
std::string str;
|
||||
|
||||
str = "";
|
||||
while (str != "EXIT")
|
||||
while (!std::cin.fail() && str != "EXIT")
|
||||
{
|
||||
std::cout << "Phonebook > ";
|
||||
std::getline(std::cin, str);
|
||||
|
||||
if (str == "ADD")
|
||||
ph.addContacts();
|
||||
else if (str == "SHOW")
|
||||
else if (str == "SEARCH")
|
||||
ph.showContacts();
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user