I\'m trying to print escape characters as characters or strings using this code:
while((c = fgetc(fp))!= EOF) { if(c == \'\\0\') { printf(\"
Escape the slashes (use " \\a") so they won't get interpreted specially. Also you might want to use a lookup table or a switch at least.
" \\a"
switch
switch (c) { case '\0': printf(" \\0"); break; case '\a': printf(" \\a"); break; /* And so on. */ }