D
Dominique
Suppose I have:
class A
{
A(int x, int y);
};
and
class B: public A
{
.... some declarations
};
then I try:
int s, t;
B bObject(s, t);
I get a compiler error (gcc) that no constructor of the form B(int&, int&)
exists. However, I would have expected that the constructor from class A
would be invoked (since B 'is a' A). Adding a B(int x, int y), and using
that to invoke A solves the problem.
Am I doing something wrong?
Thanks
Dominique
class A
{
A(int x, int y);
};
and
class B: public A
{
.... some declarations
};
then I try:
int s, t;
B bObject(s, t);
I get a compiler error (gcc) that no constructor of the form B(int&, int&)
exists. However, I would have expected that the constructor from class A
would be invoked (since B 'is a' A). Adding a B(int x, int y), and using
that to invoke A solves the problem.
Am I doing something wrong?
Thanks
Dominique