title: strlen function using recursion in c
body: <p>I'm kida new to the recursion subject and i've been trying to write the "strlen" function using recurion, thats what i tried: </p>
  
  <pre><code>int strlen ( char str[], int i)
  {
      if ( str[i] == 0) return i+1;
      return strlen(str,i++);
  }
  </code></pre>
  
  <p>and i tried something very similiar </p>
  
  <pre><code>int strlen( char str[], int i)
  {
      if ( str[i] == 0) return 1;
      return strlen(str,i++) + 1;
  }
  </code></pre>
  
  <p>and in my main function </p>
  
  <pre><code>int main()
  {
       char word[MAX_DIGITS];
       scanf("%s",word);
       printf("%d", strlen(word,0));
       return 0;
  }
  </code></pre>
  
  <p>but my program would crash whenever i run it, what am I missing? (I'm using C90 btw)</p>