Created
April 19, 2016 11:00
-
-
Save al3rez/9d767083716efb3ae5fab8bbdda8c738 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
/* copy input to ouput and replace each tab by \t, | |
* each backspace by \b, and each backslash by \\ | |
*/ | |
main() | |
{ | |
int c; | |
while ((c = getchar()) != EOF) | |
{ | |
if (c == '\t') | |
printf("\\t"); | |
else if (c == '\b') | |
printf("\\b"); | |
else if (c == '\\') | |
printf("\\\\"); | |
else | |
putchar(c); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment