title: Traversal of C string through pointer incrementation
body: <p>I'm reading through Bjarne Stroustrup's <em>A Tour of C++</em> and I'm having trouble understanding an early example. In the code below, a while loop is used to increment a pointer over a C style string until it hits the null character. What I don't get is why pointing to a null character would cause the pointer to take on the value of nullptr. It seems like it should be a perfectly good pointer that happens to point to a null value. I'd be surprised  if it were an author error since the book is included in stackexchange's reccommendations here: <a href="https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list">The Definitive C++ Book Guide and List</a></p>
  
  <pre><code>int count_x(char∗ p, char x)
      // count the number of occurrences of x in p[]
      // p is assumed to point to a zero-terminated array of char (or to nothing)
  {
      if (p==nullptr) return 0;
      int count = 0;
      for (; p!=nullptr; ++p)
          if (∗p==x)
              ++count;
          return count;
  }
  </code></pre>