Having studied the switch documentation and discovering it can only switch on integral types I set about looking for a definition. I can’t find one anywhere. I can only find a list of integral types.
I could take a guess that integral types are the types which are integrated into the language, however I’d be happier with a proper definition. Does anyone have one?
“Integral” refers to integer types (i.e. whole numbers). In C# this means types like
int,long,short, etc.Please see Integral Types Table (C# Reference):
Edit: Keep in mind that the
switchstatement supports literal strings as well.