06-16-2002
2,
0
Join Date: Mar 2002
Last Activity: 17 June 2002, 11:14 PM EDT
Posts: 2
Thanks Given: 0
Thanked 0 Times in 0 Posts
vis
Hey guys, I dont know if this is the section to put this in, but this was the closest one anyway, Im trying to modify this program so it can 'fold long lines at some reasonable length'
Any suggestions??
/* vis: make funny characters visible (version 1) */
#include <stdio.h>
#include <ctype.h>
main()
{
int c;
int i=1;
while ((c = getchar()) != EOF)
if (isascii(c) &&
(isprint(c) || c=='\n' || c=='\t' || c==' '))
i++;
putchar(c);
if(i > 65) {putchar('\n') ;i = 0;}
else
printf("\\%03o", c);
exit(0);
}