Cheers, I got constructors sorted.
Next, I thought functions from parent classes got inhirited?
If so, can somebody correct the following code snipit please
Code:
#include <iostream.h>
class mploygon
{
public:
mploygon ()
{
}
mploygon(int a, int b)
{
cout << "Total = " << a + b << endl;
}
bool Area(int a, int b)
{
cout << "Area = " << a * b << endl;
return (1);
}
};
class mTriangle : mploygon
{
public:
mTriangle(int a, int b) : mploygon (a,b)
{
cout << "This is the triangle constructor" << endl;
}
};
int main()
{
mTriangle * b = new mTriangle(5,5);
b->Area(5,5);
return(0);
}
The dodgy line is ;