From a0fdba098ae310987eebe5c9249abc10132c4bfc Mon Sep 17 00:00:00 2001 From: CarlosF03R Date: Wed, 25 Sep 2024 11:16:17 -0700 Subject: [PATCH] Resolved entire line of input, Closes #2 --- main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index f2ddce4..1b5e6ab 100644 --- a/main.cpp +++ b/main.cpp @@ -14,8 +14,11 @@ int main(){ else{ cout << "What is your next favorite?\n"; } - cin >> input; - list.push_back(input); + + getline(cin, input); + if(input != "done"){ + list.push_back(input); + } }while( input != "done" ); cout << "Your favorite list:\n"; @@ -24,4 +27,4 @@ int main(){ } return 0; -} \ No newline at end of file +}