#include <stdio.h>

int main(void) {
    int count[256];
    for (int i = 0 ; i != 256 ; count[i++] = 0);
    char *str = "AACDBACBAabcAcddaAABD";
    for (char *p = str ; *p ; count[(int)*p++]++);
    char array_values[] = { 'A','B','C','D','a','b','c','d' };
    for (int i = 0 ; i != 8 ; i++) {
        printf("Found '%c' %d times\n", array_values[i], count[(int)array_values[i]]);
    }
    return 0;
}
