How important is "break:"?

Hello I have a question about code syntaxis:

If I change "break:" by delay(time). means the same thing?

What is the equivalent meaning of that?

Posting pictures of code is discouraged. Please consider editing your post and posting the code in code tags.

1 Like

No. They are entirely different things.

1 Like

Google:
Arduino Break

Arduino delay()

1 Like

Also google: c++ switch case break

1 Like

guessing you're asking about "break" in a switch statement.

one option is to have return which exits the function
another option is not to have break which continues processing of the next case which makes sense in some situations

in general, break replaces the use of goto which also have valid uses that can significantly simplify code when done properly.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.