"Access violation reading location 0x00000000" means that you're derefrencing a pointer that hasn't been initialized and therefore has garbage values. Those garbage values could be anything, but usually it happens to be 0
and so you try to read from the memory address 0x0
, which the operating system detects and prevents you from doing.
Check and make sure that the array invaders[]
is what you think it should be.
Also, you don't seem to be updating i
ever - meaning that you keep placing the same Invader
object into location 0
of invaders[]
at every loop iteration.