View Single Post
Old Nov 2nd, 2005, 8:48 PM   #3
bivhitscar
Hobbyist Programmer
 
bivhitscar's Avatar
 
Join Date: Oct 2005
Location: Melbourne, Australia
Posts: 126
Rep Power: 3 bivhitscar is on a distinguished road
Quote:
Originally Posted by nindoja
printf("\\n");
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?
__________________
it's ironic considerate rarity patron of love higher knowledge engulfs me...
bivhitscar is offline   Reply With Quote