- 1
I don't really fully get what "case" And "break" are doing -- I'm mainly just copying the code there -- anyone have any helpful hints?
2 Respuestas
+ 3
think of it as "Perform the following statements if...."
then you have a list of choices (cases)
you then are saying "in this case, do something"
"in another case, do something else"
the "something" is any number of c++ statements
the break is used to indicate when to stop running the statements for a case
0
Think of it as multiple choice. Each case is an option and will be output if the case is met. Break simply ends the case and serves the same purpose as a period does in a sentence.