For the C specification to create a GLubyte variable, you call it
const GLubyte* glGetString(GL_VERSION );
then you can get the version. as follows
const char *GLVersionString = glGetString(GL_VERSION);
int OpenGLVersion[2];
glGetIntegerv(GL_MAJOR_VERSION, &OpenGLVersion[0])
glGetIntegerv(GL_MINOR_VERSION, &OpenGLVersion[1])
here is more general information about glGetString:
glGetString returns a pointer to a static string describing some aspect of the current GL connection. name can be one of the following:
GL_VENDOR
Returns the company responsible for this GL implementation.
This name does not change from release to release.
GL_RENDERER
Returns the name of the renderer.
This name is typically specific to a particular configuration of a hardware platform.
It does not change from release to release.
GL_VERSION
Returns a version or release number.
GL_SHADING_LANGUAGE_VERSION
Returns a version or release number for the shading language.
GL_EXTENSIONS
Returns a space-separated list of supported extensions to GL.