Code :
#include <stdio.h>
int main (void)
{
int a = 1;
switch(a) {
int t= 4;
case 1:
printf("%d", t);
break;
default: //Does not mean anything just for clarity
break;
}
}
Result in C11 gcc: 1
Question: Why is this working? Isn't the compiler supposed to give an error? if a is 1, shouldn't it just jump to case 1? Why is it printing 1?