title: Why can't my conditional detect an empty char?
body: <p>I'm trying to create &quot;String Array Count&quot; function. How does it it work? The loop is going to stop if the char is empty, then the length is going to show. The error is, empty char conditional didn't detect empty char. The result is infinite while loop.</p>
  <p>Edit : I want the result of my function is 3</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  #define s 1000
  int strarrlen(char str[s][s]){
      int i, len = 0;
      while (1){
          if(str &amp;&amp; !str[i]){
              break;
          } else {
              len += 1;
          }
          i++;
      }
      return len;
  }
  
  int main(){
      char words[s][s] = {&quot;First&quot;, &quot;Second&quot;, &quot;Third&quot;};
      printf(&quot;words array total is %i&quot;, strarrlen(words));
  }
  </code></pre>