I would use a std::vector as laserlight suggested, but if you still feel like using raw pointers, you can use std::fill() to set them all to NULL.