Okay, so I have this program, and it has a class "Hero" class Hero{};
I declare things from it using:
1 2 3 4
Hero hero1;
Hero hero2;
Hero hero3;
//etc...
Well I want to do something like:
1 2 3
for(a=1;a<10;a++){
Hero heroa;
}
But obviously I can't because the a in: Hero heroa;
would read as an a, not a variable... So how can I make this work? I want to do it this way because it's going to involve the user filling information into hero1, then it'll ask the user if he/she wishes to continue, if so, it'll make a hero2, which information will be filled into, etc... until the user decides to quit. I have everything worked out but this one little part. Help?
OH! I see now. Someone else suggested something about a vector array to me, and I thought he was saying to make a vector array and then put each hero into it separately. I totally get it now, thank you.