title: use of const char * in arrays for reading sequential files
body: <p>apologies if this is a basic question but I haven't been able to figure it out from other posts. I'm trying to read a bunch of images that are labelled <code>"1.jpg"</code> <code>"2.jpg"</code> <code>"3.jpg"</code> etc.  I'd like to do so using a for loop. The file reader (I'm using SOIL here, as recommended in the OpenGL nehe tutorial I'm following), requires a <code>const char*</code> as the filename input.</p>
  
  <pre><code>char numbers[6] = "123456"; 
  
  for (int i=0;i&lt;6;i++)
  {
     const char* filestring = new char[5];
     *filestring = numbers[i] + ".jpg";
  
     texture[i] = SOIL_load_OGL_texture(filestring, ...
     ...  // filestring should be const char* form
  }
  </code></pre>
  
  <p>The errors are:</p>
  
  <blockquote>
    <blockquote>
      <p>(1) error: initializer-string for array of chars is too long [-fpermissive]</p>
    </blockquote>
  </blockquote>
  
  <p>but i don't see what is wrong with <code>char numbers[6] = "123456"</code>?</p>
  
  <blockquote>
    <blockquote>
      <p>error: assignment of read-only location '* filestring'</p>
      
      <p>error: invalid conversion from 'const char*' to 'char' [-fpermissive]</p>
    </blockquote>
  </blockquote>
  
  <p>I'm a bit baffled. Would be grateful for any advice!</p>
  
  <p>Thanks.</p>