/*********************************************/ /* ascii.c */ /* Generate ASCII table */ /* To build: gcc -O2 ascii.c -o ascii-table */ /* */ /*********************************************/ #include #define MAX 255 /* FF hex */ #define FILENAME "ASCII.txt" /* Outfile name */ int main() { int i; FILE *fp; fp = fopen (FILENAME, "a" ); for( i = 1; i <= MAX; i++ ) { /*fprintf( fp, "%3d ", i );*/ fputc( i, fp ); fprintf( fp, "\n" ); /*if ( i % 5 == 0 ) fprintf( fp, "\n" );*/ } fprintf( fp, "\n" ); return (0); } /* Outfile needs a bit of hand-editing for tidying up. */ /* Try rewriting this as a shell script. */ /* Not so easy, huh? */