Any ways to improve this implementation (significantly)?
<p>This is a piece of code I've written for a homework. It seems to work but I wonder if I missed something.</p>

<p>The task was to implement a function (here: <code>Countwords</code>) which counts all words in a char *. No library functions should be used.</p>

<pre><code>namespace {

bool IsPrintable(char c) {
  return c &gt;= '!' &amp;&amp; c &lt;= '~';
}

void SkipPrintable(const char *&amp;s) {
  do {
    s++;
  } while (IsPrintable(*s));
}

bool IsWhiteSpace(char c) {
  return c == ' ' || c == '\t' || c == '\n';
}

void SkipWhitespace(const char *&amp;s) {
  while (IsWhiteSpace(*s)) {
      s++;
  }
}

} // namespace

int CountWords(const char *s) {
  int count = 0;

  while (*s != '\0') {
    SkipWhitespace(s);

    if (IsPrintable(*s)) {
        count++;
        SkipPrintable(s);
    }
  }

  return count;
}
</code></pre>
