I am trying to do a switch statement which analyses multiple expression:
Is this possible? I am getting errors compiling:
But its not throwing me out for passing 2 expressions to the switch statement...which leads me to believe this may well be possible....
Cheers,
Code:
int main(){
char str1[] = "H";
char str2[] = "B";
switch ( * str1, * str2 ){
case 'H''B':
printf("%s","YUP");
break;
case 'B''B':
printf("%s","NOPE");
break;
}
printf("%s", str1 );
}
Is this possible? I am getting errors compiling:
Code:
JAMESP>cc test2
case 'H''B':
................^
%CC-E-NOCOLON, Missing ":".
at line number 21 in file $1$DGA101:[JAMESP.SMP.26856]TEST2.C;17
case 'B''B':
................^
%CC-E-NOCOLON, Missing ":".
at line number 25 in file $1$DGA101:[JAMESP.SMP.26856]TEST2.C;17
But its not throwing me out for passing 2 expressions to the switch statement...which leads me to believe this may well be possible....
Cheers,