No matching function for call to 'RandomListNode::RandomListNode()


  • 0
    R

    can not use new in cpp code? or I should use malloc, or write a construction function myself for this new operation of this struct?


  • 0
    M

    There is only a constructor accepting a int value: RandomListNode(int x), no default constructor.
    You must be using like new RandomListNode();


  • 0
    R

    hah thanks, i tried malloc before and it's ok. I will use RandomListNode(int x) instead since now


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.