Possible Duplicate:
how to check for the “backspace” character in C
I just want to copy its input to its
output, replacing each tab by \t, each
backspace by \b, and each backslash by
\\. However, i use the similar method
like replacing each tab by \t cannot
replacing each backspace by \b.How can
I capture backspace?
  #include<stdio.h>
    main(){
      int c;
      char tab='t';
      char bsps='b';
      int i;
      int j;
      while((c=getchar())!=EOF)
      { 
        if(c == 9)
        { 
            putchar(92);
            putchar(tab);
        } 
        else if(c == 8)
        { 
            putchar(92);
            putchar(bsps);
        } 
        else if(c == 92)
        { 
             putchar(92);
                 putchar(92);
        } 
        else putchar(c);
      }
    }