1. class composition constructor question...

I purchased a small interpolation class from www.codecogs.com (really good site, by the way) and wanted to use the interpolation class in my little project.
I am running into problems and have been struggling a bit.
I'm simplifying things, but here goes:
I have a base class called "force" a derived class called "myForce" and the math class from codecogs called "Cubic".
Base class:
Code:
```class Force
{
protected:
Maths::Interpolation::Cubic m_cubic;
public:
Force();
};
Force::Force()
{
}```
Code:
```class myForce: public Force
{
public:
SpringForce();
};```
Code:
```class Cubic
{
public:
Cubic(int n, double *x, double *y);
private:
int m_n;
double *m_x, *m_y, *m_b, *m_c, *m_d;
}```
With this code the compiler tells me that there are no appropriate default constructor available for the Cubic class. Fair enough. Can someone explain to me how does constructor of the aggregate class object (Cubic, in this case) is called?
I'm having a hard time understanding the relationship between base class constructor (that I omitted), and the constructor for the member data m_cubic that is part of the Force class.
If anyone has a simple example I'd be much grateful!!
Andre.

2. Use the initializer list. Here's a couple options:
Code:
```Force::Force() : m_cubic(0, 0, 0)
{
}```
Code:
```Force::Force(int n, double *x, double *y) : m_cubic(n, x, y)
{
}

SpringForce::SpringForce(int n, double *x, double *y) : Force(n, x, y)
{
}```
The first initializes the values to zero in the base class (probably not what you want or the Cubic class would provide a default constructor). The second lets the person constructing the Force set the values. If the user uses the SpringForce, then it should call the base class constructor with appropriate values as shown.

3. I thought that if you did not write a constructor one would be created that does not have any parameters ??

4. That's true. What about my post makes you doubt that?

In the Cubic class, you do have a constructor. That means the compiler won't create a default constructor (with no parameters) for you. That is why you have to call the existing constructor from your Force class, because there is no default constructor for it to call to initialize the m_cubic member.