3 ms·
> it was the first language that ever gave me compile error because there were cases that my switch statement didn't account for. For C, you can use the switch
by threeducks 2y ago
> it was the first language that ever gave me compile error because there were cases that my switch statement didn't account for.
For C, you can use the switch -Wswitch-enum with GCC to get warnings and add -Werror to turn the warning into an error.
- __MatrixMan__ 2y agoThe reason I was surprised is that it wasn't explicitly an enum type but rather a char (which in retrospect I suppose is sort of like an enum).