title: What is the equivalent of "size_t" in C?
body: <p>Suppose I want to make a function like</p>
  
  <pre><code>int indexOf ( char * str, char c )
  {
     // returns the index of the chracter c in the string str 
     // returns -1 if c is not a character of str
    int k = 0;  
    while (*str)
    { 
        if (*str == c) break;
        else ++str;
    }
    return *str ? k : -1;  
  }
  </code></pre>
  
  <p>but I want to make it as reliable as possible. For instance, the above only works if the largest <code>int</code> is guaranteed to be greater than or equal to the maximum size of a character array. How can I cover all my bases in pure C?</p>