I found the code below when searching on Google.
int main() { int a=10; switch(a) { case '1': printf("ONE\n"); break; case '2': printf("TWO\n"); break; defa1ut: printf("NONE\n"); } return 0; }
The compiler does not give an error, even if the "default" is replaced by any other name. It is simply running the program and exiting the program without printing. A.
Will someone tell me why the compiler does not give a default error? when it is not written as "default"?
source share