I have the following code:
glShaderSource(shader, 1, (const char **)data.c_str(), NULL);
But it makes my program crash. How do I convert
data.c_str() returns a const char*, so do this:
data.c_str()
const char*
const char *c_str = data.c_str(); glShaderSource(shader, 1, &c_str, NULL);