case label does not reduce to an integer constant

case label does not reduce to an integer constant.

Description


Case expressions must be integer constants.

Example


case label does not reduce to an integer constant
case label does not reduce to an integer constant

Output


output: case label does not reduce to an integer constant
output: case label does not reduce to an integer constant

How to fix it ?


Case expressions must be integer constants.

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 *