well '\1' is the character constant 1, 1 is the value 1 and '1' is the character constant for the digit 1
'\1' == 1
'1' == 49 == ASCII code for 1
The continue is not working with the switch, you will notice that the switch is inside a for loop. The continue is working with that loop.
-
for(i=0;(c=input[i])!='\0';i++)
-
{
-
switch(c)
-
{
-
case 'a':
-
putchar('i');
-
// Fall through
-
case '1':
-
break;
-
-
case 1:
-
while((c=input[++i])!='\1' && c!='\0');
-
// Fall through
-
case 9:
-
putchar('S');
-
// Fall through
-
case 'E':
-
case 'L':
-
continue;
-
-
default:
-
putchar(c);
-
continue;
-
}
-
putchar(' ');
-
}
-
The loop iterrates down the string, for each character in the string an action is taken. Taking the special cases first
For 'a' ASCII value 97
output an 'i', ASCII value 105, fall through to the '1' case and break out of the switch statement, output a ' ', space ASCI value 32
For 'a' ASCII value 49
break out of the switch statement, output a ' ', space ASCI value 32
For 1, ASCII value 1
iterate down the string until you find a '\1', ASCII value 1 or '\0', ASCII value 0, fall through to the 9, ASCII value 9 (TAB) case output an 'S', ASCII value 83 fall through to the 'E' and 'L' case, continue onto the next iteration of the loop.
For 9, ASCI value 9 (TAB)
output an 'S', ASCII value 83 fall through to the 'E' and 'L' case, continue onto the next iteration of the loop.
For 'E', ASCII value 69 and 'L' ASCII value 76
continue onto the next iteration of the loop.
For any other character (default)
Output the character and continue onto the next iteration of the loop.
In terms of the code this is very very poor form as it is so hard to read it and understand what it does. I would only pass it in a code review if the author could prove that it had some performance advantage in a critical section of code.