fork download
#include 

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;
}
Success #stdin #stdout 0s 1788KB
stdin
Standard input is empty
stdout
Found 'A' 7 times
Found 'B' 3 times
Found 'C' 2 times
Found 'D' 2 times
Found 'a' 2 times
Found 'b' 1 times
Found 'c' 2 times
Found 'd' 2 times