M
Martin
Bit of a newbie question here (I'm familiar with OO in general, just
not in C++ yet).
I've seen code example where the general syntax for creating a new
object is as follows:
Thing a = new Thing(arg1, arg2);
and this returns a pointer to a new object of class 'Thing', as well
as calling its constructor.
However, it also seems like it's valid to just write this:
Thing a (arg1, arg2);
and then start using it. What is/are the differences, if any? Any
information much appreciated.
not in C++ yet).
I've seen code example where the general syntax for creating a new
object is as follows:
Thing a = new Thing(arg1, arg2);
and this returns a pointer to a new object of class 'Thing', as well
as calling its constructor.
However, it also seems like it's valid to just write this:
Thing a (arg1, arg2);
and then start using it. What is/are the differences, if any? Any
information much appreciated.