*** empty log message ***

This commit is contained in:
hjp 1998-10-12 09:55:15 +00:00
parent b020c84046
commit 95e75e05f3
2 changed files with 29 additions and 0 deletions

10
charhist/GNUmakefile Normal file
View File

@ -0,0 +1,10 @@
include GNUmakevars
include GNUmakerules
all: charhist
chartab:
clean:
rm -f charhist core foo bar baz
install: $(BINDIR)/charhist

19
charhist/charhist.c Normal file
View File

@ -0,0 +1,19 @@
#include <ctype.h>
#include <stdio.h>
#include <limits.h>
long hist[UCHAR_MAX+1];
int main (int argc, char **argv) {
int c;
while ((c = getchar()) != EOF) {
hist[c]++;
}
for (c = 0; c <= UCHAR_MAX; c++) {
if (hist[c]) {
printf ("%x %d %o %c\t%ld\n", c, c, c, isprint(c) ? c : '.', hist[c]);
}
}
return 0;
}