Basically you are instantiating your objects as part of the class definition rather than creating them somewhere else. An example would be:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
class Player
{
public:
Player()
{
}
~Player()
{
}
int getHitPoints()
{ return hitPoints; }
private:
int hitPoints;
} player1, player2, computer;
In this example we have three objects created that can now be used, player1, player2, and computer. We could also have done it this way where the objects are created elsewhere:
class Player
{
public:
Player()
{
}
~Player()
{
}
int getHitPoints()
{ return hitPoints; }
private:
int hitPoints;
};
int main()
{
Player player1;
Player player2;
Player computer;
return 0;
}
I personally don't find much use for the object list unless I know ahead of time I'm going to need a certain number of objects created. The same rules apply to structs. Make sense?