SDL OpenGl help needed

Could someone help me with the following tying to use the example from http://en.wikipedia.org/wiki/Vertex_Buffer_Object#Example_usage_in_C_Using_OpenGL_3.x_and_OpenGL_4.x
with SDL 2.0

Code:

#include <SDL.h>
#include <SDL_opengl.h>

char* filetobuf(char *file)
{
FILE *fptr;
long length;
char *buf;

fptr = fopen(file, "r"); 
if (!fptr)
    return NULL;
fseek(fptr, 0, SEEK_END); 
length = ftell(fptr);
buf = malloc(length+1); 
fseek(fptr, 0, SEEK_SET); 
fread(buf, length, 1, fptr); 
fclose(fptr);
buf[length] = 0; 

return buf; 

}

int main(int argc, char* argv[]){
SDL_GLattr attr;
int maj;
int min;

GLuint triangleVBO;

GLuint shaderProgram;

GLchar *vertexSource, *fragmentSource;

GLuint vertexShader, fragmentShader;

const unsigned int shaderAtribute = 0;

const float NUM_OF_VERTICES_IN_DATA=3;

float data[3][3] = {
{ 0.0, 1.0, 0.0 },
{ -1.0, -1.0,0.0 },
{ 1.0, -1.0, 0.0 }
};

SDL_Init(SDL_INIT_VIDEO); // Init SDL2

// Create a window. Window mode MUST include SDL_WINDOW_OPENGL for use with OpenGL.
SDL_Window *window = SDL_CreateWindow(
“SDL2/OpenGL Demo”, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, SDL_WINDOW_OPENGL|SDL_WINDOW_RESIZABLE
);

// Create an OpenGL context associated with the window.
SDL_GLContext GLContext = SDL_GL_CreateContext(window);
if(!GLContext){
// … handle error
}
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION,3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION,1);
// Now, regular OpenGL functions …
/---------------------- Initialise VBO - (Note: do only once, at start of program) ---------------------/
/* Create a new VBO and use the variable “triangleVBO” to store the VBO id */
glGenBuffers(1, &triangleVBO);

/* Make the new VBO active */
glBindBuffer(GL_ARRAY_BUFFER, triangleVBO);

/* Upload vertex data to the video device */
glBufferData(GL_ARRAY_BUFFER, NUM_OF_VERTICES_IN_DATA * 3 * sizeof(float), data, GL_STATIC_DRAW);

/* Specify that our coordinate data is going into attribute index 0(shaderAtribute), and contains three floats per vertex */
glVertexAttribPointer(shaderAtribute, 3, GL_FLOAT, GL_FALSE, 0, 0);

/* Enable attribute index 0(shaderAtribute) as being used */
glEnableVertexAttribArray(shaderAtribute);

/* Make the new VBO active. */
glBindBuffer(GL_ARRAY_BUFFER, triangleVBO);

/-------------------- Create shader program, attach shaders to it and then link it ---------------------/
/* Assign our program handle a “name” */
shaderProgram = glCreateProgram();

/* Attach our shaders to our program */
glAttachShader(shaderProgram, vertexShader);
glAttachShader(shaderProgram, fragmentShader);

/* Bind attribute index 0 (shaderAtribute) to in_Position*/
/* “in_Position” will represent “data” array’s contents in the vertex shader */
glBindAttribLocation(shaderProgram, shaderAtribute, “in_Position”);

/* Link shader program*/
glLinkProgram(shaderProgram);
/-------------------------------------------------------------------------------------------------------/

/* Set shader program as being actively used */
glUseProgram(shaderProgram);

/* Set background colour to BLUE */
glClearColor(0.0, 0.0, 1.0, 0.0);

// … can be used alongside SDL2.
SDL_Event e;
while(e.type!=SDL_QUIT){ // Enter main loop.

SDL_PollEvent(&e);      // Check for events.

glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);

glDrawArrays(GL_TRIANGLES, 0, 3);

// Swap the window/buffer to display the result.
SDL_GL_SwapWindow(window);

}
glDisableVertexAttribArray(0);

}

The shader programs are as per URL except with corrected version numbers.