Quote:
|
Originally Posted by nindoja
Basically, escape the backslash, so the escape sequence isn't seen.
|
That only works when I know what character is coming.
This is the code I'm using:
for (i = 1; i <= length; i++)
{
printf("%c = %3d, ", string[i - 1], string[i - 1]);
if (i % 8 == 0)
printf("\n");
}
That basicaly says, read the current element of the array, print the character and print it's ascii code. The if statement is just for formatting purposes.
Ideally, I just want a simple if else that says if ch == isspace() print the escape sequence instead of the actual character, else print the character. Am I making any sense?