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 4 Topic 25203 of 27670
Post > Topic >>

Re: creating a testfile for catv

by Martin Golding <fogobum@[EMAIL PROTECTED] > Mar 30, 2008 at 01:46 PM

On Sun, 30 Mar 2008 02:22:25 -0700, c gordon liddy wrote:

> What follows pur****ts to be a soln for K&R 8-1 that prints bit****fted
> control chars and non-ascii chars:
[snippage]
> How would I populate a file containing non-ascii and ctrl chars for test
> purposes? (Does anyone have one?)

mkchars.c:

#include "stdio.h"

unsigned char i;

int main(int argc, char * argv[])
{
  unsigned char buffer[256];
  do { buffer[i] = i; } while(++i);
  fwrite(buffer, 256, 1, stdout);

  return 0;
}

make mkchars
../mkchars >samplechars

../catv samplechars


Many terminal emulators will react oddly if you fail to redirect. Don't
../mkchars

Many editors will behave badly if you try to edit samplechars.

Martin
-- 
Martin Golding DoD #0236 |   fogobum@[EMAIL PROTECTED]
   
Always code as if the person who ends up maintaining your code will be a
violent psychopath who knows where you live. 
y
 




 4 Posts in Topic:
Re: creating a testfile for catv
Martin Golding <fogobu  2008-03-30 13:46:05 
Re: creating a testfile for catv
santosh <santosh.k83@[  2008-03-31 00:30:28 
Re: creating a testfile for catv
Keith Thompson <kst-u@  2008-03-30 14:14:24 
Re: creating a testfile for catv
Richard Heathfield <rj  2008-03-30 23:27:52 

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 21:56:53 CDT 2008.