Then in the default constructor for the StockItem class, in the member initialization list you have:(posted 7078 days ago)
where I would have expected to see (new UndatedStockItem()) to invoke the default constructor for that class. Is the 'no arguments' () syntax unnecessary when you're allocating memory via new? I guess that new just needs to know what type of variable it's being asked to allocate memory for. Is this right? And would putting the "()" in there cause an error, or is this a matter of preference?
[ Previous | Next ]