switch quantity not an integer

switch quantity not an integer.

Description


A noninteger value inswitch expression.

Example


Output


How to fix it ?


use only integral values in switch statements.

syntax


switch (<  expression of integer type>) {
case <integer onstant-expression> :
statement(s);
break; /* optional */

case <integer onstant-expression> :
statement(s);
break; /* optional */

/* you can have any number of case statements */
default : /* Optional */
statement(s);
}

See also


Subscribe to our channel

Leave a Reply

Your email address will not be published. Required fields are marked *