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

알뜰폰 삼성페이 교통카드 '한도 초과' 오류(등록 불가 오류) 해결방법

sk7mobile 알뜰폰 삼성페이 교통카드 등록 시, 한도 초과 문제 해결방법 skt usim 해킹 사건으로 인해 sk7mobile 알뜰폰을 사용하는 저도 usim을 바꾸고 나니 삼성페이 교통카드가 등록이 안되더라구요...  삼성페이 교통카드 기능 은...