On Sun, 30 Mar 2008 02:22:25 -0700, "c gordon liddy" <c@[EMAIL PROTECTED]
>
wrote:
>What follows pur****ts to be a soln for K&R 8-1 that prints bit****fted
>control chars and non-ascii chars:
>
snip code copied from earlier message thread
Why did you change the subject of the message and post the code again?
See the comments in the putchar thread.
>// gcc -o catv catv4.c
>// catv text24.txt >text43.txt
>
>Abridged output from text43 is:
>^JTarget: i386-pc-mingw32^J
>
>My guess is that J is what you get when you add octal 0100 to a carriage
>return. Am I correct to think that the first 32 chars are control chars?
On an ASCII system, \n (as your program sees it, not as it is stored
in the file) is 0xoa which has a decimal representation of 10.
>DEL appears to be 117 as well.
You meant \177?
>
>How would I populate a file containing non-ascii and ctrl chars for test
>purposes? (Does anyone have one?)
Open a file for output and try
int i;
for (i = 0; i <= UCHAR_MAX; i++)
fputc(i,fp);
then close the file.
Remove del for email