How is the switch statement executed here?
I am especially interested in the use of continue
.
#include <stdio.h>
int main()
{
char ch = 'A';
while (ch <= 'D')
{
switch (ch)
{
case 'A':
case 'B':
ch++;
continue;
case 'C':
case 'D':
ch++;
}
printf("%c", ch);
}
}
This outputs DE
, as you can see live on coliru.