title: Comparison of string
body: <p>I've been sitting on a code for almost ten days right now.
  I am writing a funtion that get two pointers for 2 different strings, and the function need to return 1 if there is the same number of words, or 0 if there isnt.</p>
  
  <p>I am not allowed to use any lib, global or static int etc, no loops, only recursion, not allowed to change the signature of the function.
  what I wrote is the delta between the two sentences. First my code calculates the sum of words in the first sentence, when it gets to the '\0' of the first sentence, it starts to work on the second sentence, and substract each time there is a word.
  right now the output of my funtion is the delta, I want somehow to tell the function that if the delta ("the return") is 0 return 1, else return 1.</p>
  
  <p>"</p>
  
  <pre><code>int same_num_words(char *s1, char *s2)
  {
      printf("%s\n", s1);
      printf("%s\n", s2);
      if(s1[0]=='\0' &amp;&amp; s2[0] == '\0')
      {
             return 0;
      }
      if (s1[0] == '\0' )  // AFTER first sentence is complete, substract the second sentence count.
      {
          if(s2[0]!= ' ' &amp;&amp; s2[1]== ' ')
          {
              return  same_num_words(s1, s2+1) -1 ;
          }
          if(s2[0]!= ' ' &amp;&amp; s2[1]== '\0')
          {
            return   same_num_words(s1, s2+1)-1;
          }
          return same_num_words(s1, s2+1);
      }
      if(s1[0]!='\0') // first sentence
      {
          if((s1[0]!= ' ' &amp;&amp; s1[1]== ' ') || (s1[0]!= ' ' &amp;&amp; s1[1]== '\0') ) // first sentence
          {
              return    same_num_words(s1+1, s2)+1;
          }
      }
          return  same_num_words(s1+1, s2);
  }
  "
  </code></pre>
  
  <p>any help?</p>