title: glGetShaderInfoLog to std::string?
body: <p>This is a snippet from OpenGL Super Bible 7th edition:</p>
  
  <pre><code>GLint log_length;
  glGetShaderiv(fs, GL_INFO_LOG_LENGTH, &amp;log_length);
  std::string str;
  str.reserve(log_length);
  glGetShaderInfoLog(fs, log_length, NULL, str.c_str());
  </code></pre>
  
  <p>At a first glance it seemed weird to me to pass <code>str.c_str()</code> as an argument to this function, and of course clang immediatelly protested: <code>cannot initialize a parameter of type 'GLchar *' (aka 'char *') with an rvalue of type 'const char *'</code>.</p>
  
  <p>So I tried to investigate and changed <code>str.c_str()</code> to <code>str.data()</code>, which should provide a pointer to the internal data array, but this produces the same error message. <strong>Edit:</strong> <code>c_str()</code> and <code>data()</code> are actually the same thing (in c++11 at least), so it doesn't matter which one we use.</p>
  
  <p>I did some searches, but didn't find a solution (although I'm quite new to C++ and some things are still not obvious to me).</p>
  
  <p>Is this an error in the book? And is there a way to make it work with std::string?</p>