I've created a class, let's call it classA
. I want to create in function main()
a random number of objects. How can I do this whilst naming them differently? I've tried out of desperation:
int a[100],i ,rnd;
srand ( time(NULL) );
rnd=(rand() %100);
for(i=0;i<=rnd;i++){
classa a[i];
}
but I knew it would not work.