Return a pointer by reference

Hi,

I'm trying to create a class that handles an array of pointers to the class Vertex, and I'm wanting to return one of the pointers by reference when the operator [] is used. So

std::cout << vertexpointers[i]; //should return a pointer that can be written to
vertexpointers[i] = pVertex; //should set position i to the pointer pVertex

This is what I've got in my header file but it wont compile

Vertex*& operator[ ](int i);
Anyone?

Is this question to hard for the beginners section or something? Should I move it?
Topic archived. No new replies allowed.