+ 1

Input Question

Ok, so I got this challenge from somebody else. Currently, you need to input the length of the vector so the for loop stops. Is there a way I can avoid having to input the length? Also, if you have a better way of solving this, please tell me. I'm here to learn. lol https://code.sololearn.com/c7H5NyZxSY53/?ref=app

17th Feb 2019, 3:13 PM
Daniel Cooper
Daniel Cooper - avatar
2 Réponses
+ 1
Here's a way of doing it... I recommend you read "Beginning C++17-from novice to professional".. You can download it at allitebooks.org.. https://code.sololearn.com/cGwtj9nidl88/?ref=app
17th Feb 2019, 4:43 PM
Mensch
Mensch - avatar
+ 1
Peter.. Thanks one question while(true) What's it testing? While what's true? Edit: Nevermind, I didn't notice the break statement and I got confused when trying to figure out what was stopping the loop lmao. Also, is the book free?
17th Feb 2019, 8:23 PM
Daniel Cooper
Daniel Cooper - avatar