title: Find count of character occurrences in array using recursion
body: <p>I'm pretty new with recursion. I need to write two functions. So far I wrote one, which entitles finding the length of a string. However, the second one, which is: finding the repeating character in an array is proving to be very difficult. I have scoured the web trying to find examples, I have been doing a lot of reading but nothing so far. So if you could point me in the right direction, I would really appreciate it. </p>
  
  <p>Thank you    </p>
  
  <pre><code>//length( ) -- this function is sent a null terminated array of characters.  
      //The function returns the length of the "string".    
      long slength (const char ntca[])
          {
              int length = 0;
  
              if (ntca[length] == '\0'){
                  return 0;
              }
              else{
                  return  slength(ntca+1)+1;
              }
          }
  
          //countall( ) -- This function is sent a null terminated array of characters 
          //and a single character.  The function returns the number of times the character 
          //appears in the array.
  
          long countall (const char ntca[],char letter){
  
              int position = 0;
              int counter = 0;
              long length = slength(ntca);
  
              if (length == 0)
                  return 0;
  
              else if (ntca[position]==letter)
                  return 1 + countall(ntca-1,letter);
              else 
                  return countall(ntca,letter);
  
  
          }
  </code></pre>