Get a blank window without displaying any images

I couldn’t get two displayed triangles as the first example shows in the book. All I get is a blank window. Below is my entire code, could anyone help me please ? I’ve spent a whole day on this, but still couldn’t get it right.

#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <glew.h>
#include <FreeGL\freeglut.h>

using namespace std;

GLint attribute_v=-1; // global variables
GLuint vertexbuffer;
GLuint VertexArrayID;
GLuint program;
int width=500; int height=700;

struct ShaderInfo{

GLenum vshader;
const char* vertexfile;
GLenum fshader;
const char* fragmentfile;

};

const char* getshaderprogram(const char* filename, string& shader)
{
fstream shaderFile( filename, ios::in );

if ( shaderFile.is_open() )
{
	std::stringstream buffer;
	buffer &lt;&lt; shaderFile.rdbuf();
	shader = buffer.str();
	buffer.clear();
}
shaderFile.close();

return shader.c_str();

}

GLuint LoadShaders(ShaderInfo shaderinfo)
{
GLuint program;
//load and compile vertex shader
GLuint vertexshader=glCreateShader(GL_VERTEX_SHADER);
GLuint fragmentshader=glCreateShader(GL_FRAGMENT_SHADER);
string shaderprogramtext;
const char* Vertexshadersource=getshaderprogram(shaderinfo.vertexfile,shaderprogramtext);
const GLint vlength=shaderprogramtext.size();
glShaderSource(vertexshader,1,&Vertexshadersource,&vlength);

glCompileShader(vertexshader);
for( unsigned  int i=0;i&lt;shaderprogramtext.size();++i)
{
	cout&lt;&lt;Vertexshadersource[i];
}
cout&lt;&lt;endl;
GLint status;
glGetShaderiv( vertexshader, GL_COMPILE_STATUS, &status );

if(status!=GL_TRUE)
{
	std::cerr&lt;&lt;"unable to compile the vertex shader..."&lt;&lt;endl;
}
char* infoLog=new char[100];
GLsizei buffsize=0;
glGetShaderInfoLog(vertexshader,buffsize,NULL,infoLog);
for(int i=0;i&lt;buffsize;++i)
{
	cout&lt;&lt;infoLog[i];
}
cout&lt;&lt;endl;
delete[] infoLog;

//load and compile fragment shader
string fragmentshadertext;
const char* Fragmentshadersource=getshaderprogram(shaderinfo.fragmentfile,fragmentshadertext);
const GLint flength=fragmentshadertext.size();
for(unsigned int i=0;i&lt;fragmentshadertext.size();++i)
{
	std::cout&lt;&lt;Fragmentshadersource[i];
}
cout&lt;&lt;endl;
glShaderSource(fragmentshader,1,&Fragmentshadersource,&flength);
glCompileShader(fragmentshader);

glGetShaderiv( fragmentshader, GL_COMPILE_STATUS, &status );
if ( !( status == GL_TRUE ) )
	cerr &lt;&lt; "

Fragment Shader compilation failed…" << ’
';
infoLog = new char[];
buffsize = 0;
glGetShaderInfoLog( fragmentshader, buffsize, NULL, infoLog );
for ( int i = 0; i < buffsize; ++i )
cout << infoLog[ i ] << endl;
delete [] infoLog;

// create the shader program
program = glCreateProgram();
// attach the vertex and fragment shaders to the program
glAttachShader( program, vertexshader );
glAttachShader( program, fragmentshader );

// link the objects for an executable program
glLinkProgram( program );

glGetProgramiv( program, GL_LINK_STATUS, &status );
if ( !( status == GL_TRUE ) )
	cout &lt;&lt; "Link failed..." &lt;&lt; endl;

// return the program
return program;

}

void
init(void)
{

glGenVertexArrays(1, &VertexArrayID);

glBindVertexArray(VertexArrayID);
GLdouble vertices[6][2] = {
{ -0.90, -0.90 }, // Triangle 1
{ 0.85, -0.90 },
{ -0.90, 0.85 },
{ 0.90, -0.85 }, // Triangle 2
{ 0.90, 0.90 },
{ -0.85, 0.90 }
};
glGenBuffers(1, &vertexbuffer);
glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
ShaderInfo shaders = { GL_VERTEX_SHADER, "vertex_shader.txt" , GL_FRAGMENT_SHADER, "fragment_shader.txt" };
program = LoadShaders(shaders);


glUseProgram(program);
glVertexAttribPointer(attribute_v, 2, GL_FLOAT, GL_FALSE, 0, 0);
glEnableVertexAttribArray(attribute_v);
const GLchar* attribute_name = "attribute_v";  // this name has to be the same variable name in the vertex_shader file. 
attribute_v = glGetAttribLocation(program, attribute_name);   // check attribute activated. 
if (attribute_v == -1) {
	cout&lt;&lt;"could not bind attribute for vertex..."&lt;&lt;endl; 
}

}

void
display(void)
{
//glClearColor(1.0f,1.0f,1.0f,1.0f);
glClear(GL_COLOR_BUFFER_BIT);

glBindVertexArray(VertexArrayID);
glDrawArrays(GL_TRIANGLES, 0, 6);
glFlush();

}

int
main(int argc, char** argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_RGB);
glutInitWindowSize(500,500);
glutInitWindowPosition(200,200);
glutInitContextVersion(4, 5);
glutInitContextProfile(GLUT_CORE_PROFILE);
glutCreateWindow(“Triangle Visualization”);

glewExperimental = GL_TRUE; 
if (glewInit()) {
cerr &lt;&lt; "Unable to initialize GLEW ... exiting" &lt;&lt; endl;
exit(EXIT_FAILURE);
}
cout&lt;&lt; "The version of opengl is : "&lt;&lt;glGetString(GL_VERSION)&lt;&lt;endl;

init();
glutDisplayFunc(display);
glutMainLoop();

}

getshaderprogram is returning a pointer to a local std::stringstream, make std::stringstream buffer global or, better yet, return a std::string and get the address of it (&) in the LoadShaders function.