What do we iterate through when using pointer to an array?
<p>This is a simple function for finding occurrences of a specific letter.  </p>

<pre><code>1:  int count_x(char *p, char a)
2:  {
3:      int count = 0;
4:      while(*p != '\0')
5:      {
6:        if (*p == a)
7:            count++;
8:        p++;
9:      }
10:      return count;
11:  }
</code></pre>

<p>We can get access to a specific element by using <code>p[n]</code>, or we can dereference it <code>*p</code> and get a first element of that array as an example, and all of that stuff we usually do.<br>
The strange thing to me is located at the line number 8.
When we write <code>p++</code>, we are getting the array we passed -1 symbol from the beginning. So if it was <code>hello, world</code> then it would be <code>ello, world</code>.
We are somehow iterating throuhg the indices but i don't really understand how.  </p>

<p>Can i have an explanation of how all of that stuff works?</p>