title: In this program how this line work "flag[str[i]-'a']++;" can anyone explain?
body: <p>I have doubt in this line <code>flag[str[i]-'a']++;</code> how this line work.
  For full program visit <a href="http://www.programmingsimplified.com/c/source-code/c-anagram-program" rel="nofollow">http://www.programmingsimplified.com/c/source-code/c-anagram-program</a></p>
  
  <pre><code>char str[44];  
  int flag[26],i=0;
  gets(str);  
  while(str[i]!='\0')
  {
     flag[str[i]-'a']++; // How this line work
     i++;
  }
  i=0;
  while(str[i]!='\0')
  {
     printf("\n%d, %d ",str[i]-'a');
     i++;                        
  }
  </code></pre>