C What is ""first[a[c]-'a']++;"
<p>I have started with C in my school and (as I'm slowly ending) I came across a question about programming an anagram checker. After some thinking I still couldn't figure out anything but a seperate counter for each specific letter and if the counters would match, it would be an anagram. But that seems terribly long to write (especially on paper).
So I went to search for an answer of some sorts through google, looking for an anagram solver and managed to come across some code but there's one thing there which I don't understand:</p>

<pre><code>#include &lt;stdio.h&gt;

int check_anagram(char [], char []);

int main() {
   char a[100], b[100];
   int flag;

   printf("Enter first string\n");
   gets(a);

   printf("Enter second string\n");
   gets(b);

   flag = check_anagram(a, b);

   if (flag == 1)
      printf("\"%s\" and \"%s\" are anagrams.\n", a, b);
   else
      printf("\"%s\" and \"%s\" are not anagrams.\n", a, b);

   return 0;
}

int check_anagram(char a[], char b[]) {
    int first[26] = {0}, second[26] = {0}, c = 0;

    while (a[c] != '\0') {
        first[a[c] - 'a']++;
        c++;
    }

    c = 0;

    while (b[c] != '\0') {
        second[b[c] - 'a']++;
        c++;
    }

    for (c = 0; c &lt; 26; c++) {
        if (first[c] != second[c])
            return 0;
    }

    return 1;
}
</code></pre>

<p>At first I thought this wouldn't work for anagrams longer than 26 letters so I tried some random strings longer than 26 and it did actually work. However when I went through the code, I saw that I can't understand what:
<code>first[a[c]-'a']++;</code> and <code>second[b[c]-'a']++;</code>
mean. Could someone please clarify what this is, what it does or at least what should I look for to realize these things because it doesn't add up well in my head.</p>

<p><strong>EDIT 1</strong>
- First of all you people are fast...
- Second of all, if I understand this correctly, this program shouldn't cope well with capital letters or different caps (e.g.: HELLO and hello)?</p>