What are the key points to remember about 'switch' statements in C++?

0195

The key points to remember about switch statements in C++ are:

  • When a case statement matches and executes, it will exit the current switch block unless a fallthrough is used.
  • You can use fallthrough to continue executing the next case statement.
  • The switch statement can have an initialization statement, which is separated by a semicolon from the conditional expression.

0 Comments

no data
Be the first to share your comment!