Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > Re: creating a ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 25209 of 27670
Post > Topic >>

Re: creating a testfile for catv

by Barry Schwarz <schwarzb@[EMAIL PROTECTED] > Mar 31, 2008 at 02:22 AM

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
 




 1 Posts in Topic:
Re: creating a testfile for catv
Barry Schwarz <schwarz  2008-03-31 02:22:50 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Oct 10 22:06:21 CDT 2008.