Array of pointers and segmentation fault.

So, I have this class shape, and I created an array of two pointers like this:
1
2
3
4
5
    Shape * two_shapes [2];
    two_shapes[ 1 ] = new Shape(206, 65, shape_width, shape_height,random_shape());
    two_shapes[ 2 ] = new Shape(206, 65, shape_width, shape_height,random_shape());
    two_shapes[ 1 ]->set_moving(true);
    two_shapes[ 2 ]->set_moving(false);

So far I have no problems, than program continues, I call some members functions of one of the shapes using a syntax like this:
 
two_shapes[ 1 ]->show();


In the mean time, I don't touch ... Wait,
ZERO INDEXING!

(So, I have solved my problem myself, but I found it kind of funny the way I realized my problem while I was asking about it, so still wanted to post this. It can be deleted if it is against the rules.)
Topic archived. No new replies allowed.