Top "Switch-statement" questions

In computer programming, a switch, case, select or inspect statement is a type of selection control mechanism used to invoke specific blocks of code based on variable contents.

Perl - Output the log files

I have created a perl that telnet to multiple switches. I would like to check if telnet functions properly by …

perl logging switch-statement telnet cisco
C - Tricky Switch Case working .. !

Folks, Recently started learning C. Stuck at a point. Its about working of switch-case statement. Here's the code : #include<…

c switch-statement case-statement
What does the new keyword "yield" mean in Java 13?

Java 13 introduced the yield keyword for switch expressions. How can I use it and what's the difference to a default …

java switch-statement yield java-13
How to disable the "Chromium didn't shut down correctly" message? Chromium 17, Ubuntu 10.04

I am running Chromium in a kiosk-like environment and if the computer is powered off forcefully while Chromium is running, …

ubuntu switch-statement shutdown chromium kiosk
Switch vs toggle

I'm trying to decide whether to use a switch or toggle for setting an alarm I'm my android application. On …

android-layout switch-statement toggle uiswitch
Using a variable in a Java case statment

I am making an expression parser for a calculator. The expressions will contain a variable, for instance, a user could …

java switch-statement compile-time-constant
getchar not working in switch case (c)

Using a very simple calculator program that prompts a user for an operation to perform, followed by a prompt for …

c switch-statement getchar input-buffer
Java switch : variable declaration and scope

How does the Java compiler handle the following switch block ? What is the scope of the 'b' variable ? Note that …

java scope initialization switch-statement variable-declaration
c++ multiple enums in one function argument using bitwise or "|"

I recently came across some functions where you can pass multiple enums like this: myFunction(One | Two); Since I think …

c++ enums switch-statement binary-operators
Swift 2: expression pattern of type 'Bool' cannot match values of type 'Int'

I'm doing this problem set "FizzBuzz", and my switch statement is giving me some problems, here's my code: func fizzBuzz(…

swift switch-statement fizzbuzz