title: C - Find most frequent element in char array
body: <p>i'm developing a little function to display the most frequent character in a (char) array.
  This is what I've accomplished so far, but I think i'm on the wrong way.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  int main()
  {
  
  char test[10] = "ciaociaoci";
  max_caratt(test, 10);
  
  }
  
  int max_caratt(char input[], int size)
  {
  int i;
  char max[300];
  max[0] = input[0];
  
  for (i=0; i&lt;size; i++)
  {
  
      if(strncmp(input,input[i],1) == 1)
      {
          printf("occourrence found");
          max[i] = input[i];
      }
  
  
  }
  
  }
  </code></pre>
  
  <p>Any help?</p>