Original Post
I'm very confused. I've been working at this problem for days and cant get it. I'm trying to use the -> operator to set a value in a class pointer array defined as bullet *bullets [20]. It compiles fine but when I debug it i come up with a access violation. Here's the code. What's the problem? #include typedef class bullet { public: int alive; int x,y; int speed; int side; }; bullet *bullets[20]; int main() { bullets [1]->alive = 0; bullets [1]->x = 0; bullets [1]->y = 0; bullets [1]->side = 0; bullets [1]->speed = 0; }