Jin Jung Jin Jung - 1 year ago 99
C++ Question

c++ how to read this creating new constructor code?

LinkedListNode* toSort = new LinkedListNode((MTNode*)0, (LinkedListNode*)0,

can someone give me detail explanation on how to read this code??
especially, I don't understand those zeros in

(MTNode*)0, (LinkedListNode*)0,(LinkedListNode*)0

Answer Source

In a bit more modern c++, it would look like:

LinkedListNode* toSort = new LinkedListNode(nullptr, nullptr, nullptr);

Does it make more sense now? It just passes null values for each expected pointer.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download