Feb 25, 2022 at 1:28pm UTC
The OP isn't really clear.
If it is in the array, it should ask for another number to check
If it is, the program should quit the loop
These are, of course, mutually exclusive. I took the first requirement. If the second, then my L23 becomes:
} while (std::find(numsies.begin(), numsies.end(), num) == numsies.end());
Last edited on Feb 25, 2022 at 1:30pm UTC
Feb 25, 2022 at 1:52pm UTC
I did the same thing with my code, if the search found the number in the container bail. Otherwise request another number to find.
Want to loop when a number is found? My line 27 if checks for equality with a modified output of num NOT found and jumps the shark.
Feb 25, 2022 at 1:59pm UTC
seeplus's first sugestion worked perfectly fine, just what I wanted my program to do :D Thanks a bunch!! And also thank you to the others, as well!
P.S.: Sorry for the half-Hungarian code ^^'