title: Understanding character array in C
body: <pre><code>#include&lt;stdio.h&gt;
  #include&lt;string.h&gt;
  
  int check_pal(char *s)
  {
      int l = strlen(s),mid,i,h1[256]={0},h2[256]={0};
      mid = l/2;
      if(l&amp;1)
          for(i=0;i&lt;mid;i++)
          {
              //printf("%c %c\n",s[i],s[i+mid]);
              h1[s[i]]++;
              h2[s[i+mid+1]]++;
          }
      else
          for(i=0;i&lt;mid;i++)
          {
              //printf("%c %c\n",s[i],s[i+mid]);
              h1[s[i]]++;
              h2[s[i+mid]]++;
          }
  
      for(i=0;i&lt;256;i++)
          if(h1[i]!=h2[i])
              return 0;
      return 1;
  }
  
  int main()
  {
      int t;
      char s[1001];
      scanf("%d",&amp;t);
      while(t--)
      {
          scanf("%s",s);
          if(check_pal(s))
              printf("YES\n");
          else
              printf("NO\n");
      }
      return 0;
  }
  </code></pre>
  
  <p>In the above program I want to understand the step <code>h1[s[i]]++;</code> and
  <code>h2[s[i+mid]]++;</code></p>