The code would be better written as:
[compressed again -dM]
#include <limits.h>
void foo(char *s)
{ size_t charcount[-CHAR_MIN + CHAR_MAX];
memset(charcount,0,sizeof(charcount));
for ( ; *s ; s++) charcount[*s + -CHAR_MIN]++; }
Okay, class, now who can find the bug in _this_ version? (Yes, there
is one.)
/~\ The ASCII der Mouse
\ / Ribbon Campaign onetime comp.lang.c maven
X Against HTML mouse(a)rodents.montreal.qc.ca
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B