well, alex use rand() and randamize() function. ( as given in one of the previous post).
use arrays only if you are a beginner.
otherwise use vectors or pointers.
For pointers, I am giving a helpful code snippet
randimize();
.
.
.
for ( i = 0; i != NULL; i++ ) // use stdlib.h or stdio.h ( may be cstdlib or cstdio as the case may be)
*( age + i ) = rand();
Here, the advantage is that the poor compilers will have to take care of all the memory management , you are left with other issues.
Also, this progam will run, most of the times without any modification on your part if variable number is to be handled.
use vector, only if developing a commercial project as it support STL and will give you ample options to modify/ improve the code if client requires to do so.
Hope, this will help. If you need more assistance then reply in the post.
*Manoj