*** empty log message ***
This commit is contained in:
parent
b020c84046
commit
95e75e05f3
|
@ -0,0 +1,10 @@
|
|||
include GNUmakevars
|
||||
include GNUmakerules
|
||||
|
||||
all: charhist
|
||||
|
||||
chartab:
|
||||
clean:
|
||||
rm -f charhist core foo bar baz
|
||||
|
||||
install: $(BINDIR)/charhist
|
|
@ -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;
|
||||
}
|
Loading…
Reference in New Issue