P
paallikko.rosvo
Hi,
If I have the following passage of code:
class A
{
public:
A() {}
A(int a) {}
};
class B
{
A a;
A b(10);
};
Why is "A a" legal in this context and "A b(10)" is not? Is there any
way to achieve the same thing with a constructor that takes arguments?
I wouldn't like to use naked pointers.
Thanks!
-R
If I have the following passage of code:
class A
{
public:
A() {}
A(int a) {}
};
class B
{
A a;
A b(10);
};
Why is "A a" legal in this context and "A b(10)" is not? Is there any
way to achieve the same thing with a constructor that takes arguments?
I wouldn't like to use naked pointers.
Thanks!
-R