title: passing a pointer by reference in c++
body: <p>I have a function where I'm passing in an iterator to a char * buffer (which is also a char *).  The function needs to increment the iterator.  Anyway, I found that a good method of passsing the iterator into the function is by passing the pointer by reference:</p>
  
  <pre><code>bool myFunction(unsigned char * &amp;iter)
  {
     ...
  </code></pre>
  
  <p>However, I've heard that this is bad form and could cause problems.  Here is the method that my coworker suggested I use:</p>
  
  <pre><code>typedef unsigned char * unsignedcharptr;
  bool myFunction(unsignedcharptr &amp;iter)
  {
     ...
  </code></pre>
  
  <p>It looks to me like they're both doing the same thing.  Is there a compiler difference between these two methods (I'm using Visual Studio 2005)?  Which is correct?</p>