/* prog to count characters by hex values and output a table * of same; reads from stdin; to use with a file 'fname' invoke * as: * countchar main () { long a[256]; int i; unsigned int c; for (i = 0; i < 256; ++i) a[i] = 0; while ((c = getchar()) != EOF) ++a[c]; for (i = 0; i < 256; ++i) printf ("%3d %10ld\n", i, a[i]); }