title: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::c_str': non-standard syntax; use '&' to create a pointer to member
body: <p>I'm trying to make a function that can read and compile opengl vertex and fragment shader files, but I'm getting this error:</p>
  
  <pre><code>'std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt;&gt;::c_str': non-standard syntax; use '&amp;' to create a pointer to member
  </code></pre>
  
  <p>I'm not quite sure how to fix it. Here is my code:</p>
  
  <pre><code>GLuint shader_load(const GLchar* vertex, const GLchar* fragment) {
  
  std::string ver = file_read_all(vertex);
  std::string frag = file_read_all(fragment);
  
  const GLchar* verCode = ver.c_str;
  const GLchar* fragCode = frag.c_str;
  
  GLuint program;
  
  GLuint verShader, fragShader;
  GLint success;
  GLchar log[512];
  
  verShader = glCreateShader(GL_VERTEX_SHADER);
  glShaderSource(verShader, 1, &amp;verCode, NULL);
  glCompileShader(verShader);
  glGetShaderiv(verShader, GL_COMPILE_STATUS, &amp;success);
  
  if (!success) {
      glGetShaderInfoLog(verShader, 512, NULL, log);
      std::cout &lt;&lt; "Failed to compile Vertex Shader\n" &lt;&lt; log &lt;&lt; std::endl;
      return NULL;
  }
  
  fragShader = glCreateShader(GL_FRAGMENT_SHADER);
  glShaderSource(fragShader, 1, &amp;fragCode, NULL);
  glCompileShader(fragShader);
  glGetShaderiv(fragShader, GL_COMPILE_STATUS, &amp;success);
  
  if (!success) {
      glGetShaderInfoLog(fragShader, 512, NULL, log);
      std::cout &lt;&lt; "Failed to compile Fragment Shader\n" &lt;&lt; log &lt;&lt; std::endl;
      return NULL;
  }
  
  program = glCreateProgram();
  
  glAttachShader(program, verShader);
  glAttachShader(program, fragShader);
  
  glLinkProgram(program);
  
  glGetProgramiv(program, GL_LINK_STATUS, &amp;success);
  if (!success)
  {
      glGetProgramInfoLog(program, 512, NULL, log);
      std::cout &lt;&lt; "Failed to Link Shader\n" &lt;&lt; log &lt;&lt; std::endl;
  }
  
  glDeleteShader(verShader);
  glDeleteShader(fragShader);
  }
  </code></pre>
  
  <p>I'm using Visual Studio Community 2015 on Windows 10</p>