In a switch statement is it possible to do something like this in c
Code:
result = -1;
switch ( result ) {
case 1:
printf("FILENAME ERROR #:%d -Partial match; the name fits the left-hand pattern sections. ", result);
break;
case 0:
printf("FILENAME ERROR #:%d -Partial match; No match; the name does not fit the pattern. ", result);
break;
case -1,-2:
printf("FILENAME ERROR #:%d -An error occurred, CHECK PARAMETERS. ", result);
break;
}
or even this:
Code:
result = -1;
switch ( result ) {
case 1:
printf("FILENAME ERROR #:%d -Partial match; the name fits the left-hand pattern sections. ", result);
break;
case 0:
printf("FILENAME ERROR #:%d -Partial match; No match; the name does not fit the pattern. ", result);
break;
case < 0 :
printf("FILENAME ERROR #:%d -An error occurred, CHECK PARAMETERS. ", result);
break;
}
Because for both attempts don't work in c i was wondering if there is a different syntax for it.