title: Cannot convert const char * to char *
body: <p>Visual Studio c++ 2005</p>
  
  <p>I am getting an error on the last line of this code. </p>
  
  <pre><code>int Utils::GetLengthDiff ( const char * input, int &amp; num_subst ) 
  {
      int num_wide = 0, diff = 0 ; 
      const char * start_ptr = input ; 
  
      num_subst = 0 ; 
      while ( ( start_ptr = strstr ( start_ptr, enc_start ) ) != NULL ) 
      {
          char * end_ptr = strstr ( start_ptr, enc_end ); // Error
  </code></pre>
  
  <p>So I changed the line to this and it worked ok</p>
  
  <pre><code>const char * end_ptr = strstr ( start_ptr, enc_end ); 
  </code></pre>
  
  <p>So why would I need to declare end_ptr as a const as well?</p>
  
  <p>Many thanks,</p>