You might also be interested in using the stl containers such as <vector>.