Say I have a "Ragdoll" class that is composed by 10 "balls"
class Ragdoll
{
Ball balls[10];
};
And the Ball class contains a pointer to the owner ragdoll:
class Ball
{
...
Ragdoll* owner;
};
I want the ball class to have a constructor which takes as parameter the pointer to the Ragdoll which owns it:
something like
Ball::Ball(Ragdoll* ownerin)
{
owner=ownerin;
}
The problem is I dont know how to call the Ball::Ball constructor when I make a ragdoll!
Say I call
Ragdoll ragdolls[2]
I dont know where-how to specify the argument for the Ball constructor!
Got a Mac? Check out my game at [a]http://www.radicalrebound.com[/a]