Where to put break; due to user invalid input

Nov 7, 2021 at 2:48am
Hello I'm new to c++, I'm creating a reservation system for my school project this is kinda a dumb question where should I put break; due to user invalid input. Can't post the whole system because it's too long here is the link below. Thanks






<https://onlinegdb.com/1jCyDDg3U>
Last edited on Nov 7, 2021 at 2:51am
Nov 7, 2021 at 3:01am
Your link is borked. Remove the angle brackets.

Do not EVER call main() in your code. You can call other functions, but never main().
Nov 7, 2021 at 4:04am
typically you don't break.

input validation is usually
do
prompt
get value as string
validate input
while (not valid)

the only time you would break or do something odd is like a password, where you might have 3 tries then lock them out or whatever. Do you need that idea?
Topic archived. No new replies allowed.