if the source don't exist "default" in "Switch case" syntax ?

if the source don't exist "default" in "Switch case" syntax ?

this isn't error, but warning.

for example,

int test = 10;

printf("here 1");

switch (test) {
case 1:
break;
}

printf("here 2");


result console
here 1
here 2

you can show in this case, don't need to "default".
i think the compiler does write automatically.
but, this is warning.
i recommend to write "default".


No comments:

Post a Comment

Apartment Buying Guide 2025: Shocking Red Flags You Should NEVER Ignore!

 🏙️ Apartment Buying Guide 2025: Shocking Red Flags You Should NEVER Ignore! 🚨 Are you thinking about buying an apartment in 2025? 🏢  It’...