Jin Jung Jin Jung - 1 month ago 7
C++ Question

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

LinkedListNode* toSort = new LinkedListNode((MTNode*)0, (LinkedListNode*)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

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.