How to use GLEW?

#include <gl/glew.h>
#include <gl/glut.h>
//#include <gl/glprocs.h>

static GLint vertices[] = { 25, 25,
100, 325,
175, 25,
175, 325,
250, 25,
325, 325 };

static GLfloat colors[] = { 1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0,
0.75, 0.75, 0.75,
0.35, 0.35, 0.35,
0.5, 0.5, 0.5 };

void setupVertex()
{
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);

glVertexPointer(2, GL_INT, 0, vertices);
glColorPointer(3, GL_FLOAT, 0, colors);
}

void init()
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glShadeModel(GL_SMOOTH);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0, 400.0, 0.0, 400.0);
setupVertex();
}

void display()
{
glClear(GL_COLOR_BUFFER_BIT);
GLuint front[] = {0, 1, 2, 3, 4, 5 };
//glDrawElements(GL_LINES, 3, GL_UNSIGNED_INT, front);
glDrawRangeElements(GL_LINES, 1, 2, 2, GL_UNSIGNED_INT, front);
glFlush();
}

int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(400, 400);
glutInitWindowPosition(100, 100);
glutCreateWindow("");

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

return 0;
}

If I used glDrawRangeElements() directly, the program will crash? Could anyone tell me how to use glew? Thanks.

You forgot to call glewInit(), also see http://glew.sourceforge.net/#Use