Home > Back-end >  Why is the SWITCH * # WaMP *
Why is the SWITCH * # WaMP *

Time:12-08


# include "stdio.h"
The main ()
{char STR []="SSSWILTECH1 \ \ 11 w \ 1 wallmp1";
int k; char c;
For (k=2; (c=STR [k])!='\ 0'; K++)
{switch (c)
{case 'A' : putchar (' A '); continue;
Case '1' : break;
Case 1: while ((c=STR [+ + k])!='\ 1 & amp; & c!='\ 0');
Case 9: putchar (' # ');
Case 'E' :
Case 'L' : the continue;
Default: putchar (c); continue; }
Putchar (' * '); }
}

CodePudding user response:

1. \ "1" and "1", pay attention to the escape character
2. Case 1 and case 9 will skip the middle characters
3. The break in the switch statement and continue direct role in the for loop

CodePudding user response:

Upstairs have to point out the problem, the original poster notice the escape character \, escape after, it is not the original meaning and the value of the corresponding,
  • Related