I write this code in my program,but the error is " no matching function for call to ‘ListNode::ListNode()’"。
finally I use malloc to solve this problem ,but I still want to know why my code which uses new can't compile.
thx for your anwser.
It is best to paste the part of the code in question.
yeze322 did an amazingly good job of guessing the error without code ! ;-)
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.