Ignore switch case accept integer and character value
solved problem myself
Ignore switch case accept integer and character value
solved problem myself
Last edited by Kittu20; 01-01-2023 at 01:59 AM. Reason: solved myself
For anyone else reading this, switch-case is restricted to integers by the C standard. Some types are implicitly casted to an integer, like bool (_Bool) and char. Be careful whenever you use char values. There's no ambiguity in the range of ASCII characters. However, keep in mind that the signedness of char is dependent on the implementation, that char literals are of type int as per C standard, and that the encoding of your code may represent glyphs outside of the ASCII range with more than one value (e.g. UTF-8).