switch statement reference

In the Arduino Reference Manual it is nowhere explicitly stated that the variable used for comparison in switch statements must be an integer expression and the case values must be constants. I saw on other posts that this leads into lots of problems because in many other programming languages this is not the case.

Stating this in the Reference Manual would help preventing to try with String or string and getting the error finally after compilation.

Changing the online reference would be greatly appreciated.

KIS(S) - you have a choice - wait for doc changes or let compiler error messages help you. Jim

In the Arduino Reference Manual it is nowhere explicitly stated that the variable used for comparison in switch statements must be an integer expression and the case values must be constants.

The language is C/C++ - the Arduino reference refers mostly to Arduino-specific elements; if you want chapter and verse on generic language topics, refer to K&R or Stroustrup.