J
josh
Hi all I've some doubts about the vary way to initialize an object
inside a class:
If I have an object of class B inside a Class A then to init B if it's
a ponter
a reference
a simple object and so on
I've seen (where objectB is B objectB or B *objectB) sintax like
A::A : objectB()
or
A::A()
{
objectB = B();
}
or
A::A : objectB( new B() )
or
A::A()
{
objectB = new B();
}
so which are the BEST way to accomplish that?
inside a class:
If I have an object of class B inside a Class A then to init B if it's
a ponter
a reference
a simple object and so on
I've seen (where objectB is B objectB or B *objectB) sintax like
A::A : objectB()
or
A::A()
{
objectB = B();
}
or
A::A : objectB( new B() )
or
A::A()
{
objectB = new B();
}
so which are the BEST way to accomplish that?