EmbLogic's Blog

warning: unknown escape sequence: ‘\W’ [enabled by default] and error: empty character constant

#include
char input[] =”SSSWITECHL1\1\1W\WALLMP1″;
int main()
{
int i,c;
for(i=2;(c=input[i]) !=”; i++)
{
switch(c)
{
case’a’:putchar (‘i’);continue;
case ’1′:break;
case 1:while((c=input[++i]) !=’\1′ && c!= ”);
case 9:putchar(‘s’);
case ‘E’:
case ‘L’: continue;
default: putchar(c);continue;
}
putchar(”);
}
return 0;
}

One Response to warning: unknown escape sequence: ‘\W’ [enabled by default] and error: empty character constant

  1. sheetal sharma says:

    when we put \ before a character it is count as an escape character by compiler.
    \W is examined as escape character in above program but there is no escape character ‘\W’.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>