title: Length of non-null terminated char* array
body: <p>The following method <code>slength</code> gives me an infinite loop (infinite "hello" statements). To find the length of a non-null terminated string, what do I need to look out for since there is no '\0'?.</p>
  
  <pre><code>int slength(const char *s) {
   printf("hello");
   int i = 0;
   while (s != NULL) {
      i++;
      s++;
      printf("hello");
   }
   return i;
  }
  </code></pre>
  
  <p>This method seems to work but I feel there are too many checks to consider. Is there an easier way?</p>
  
  <pre><code>int silength(const char *s) {
      int i = 0;
       while( (*s&gt;='a'&amp;&amp; *s&lt;='z') || (*s&gt;='A' &amp;&amp; *s&lt;='Z') || *s == ' ') {
      i++;
      s++;
      printf("hello\n");
   }
   return i;
  }
  </code></pre>