creating objects

Hello,

i have a question :

if I have classes like:

1
2
3
4
5
6
7
8
9
10
class A
{
  public:
     A(int);
}
 class B 
{
   public:
     B(const A&);
}


how do I create obejct of those classes?

First one :

A a(10);

and second one? Like this?:

B b= a;

Or how? Thanks a lot for your answer.
Those two are correct.
Also these are equivalent :
A a(10); and A a = 10;, but only if A::A(int) isn't declared explicit, if it is then only A a(10); is correct. Same goes for B.
Last edited on
Thanks, at least I got something right. :D
Topic archived. No new replies allowed.