Class variable in a class of itself C++

  c++, class

I have a class called Node:

class Node {
    private:
    Node right;
    Node left;
    std::string value;
    public:
    Node(Node right, Node left, std::string value) {
        this->right = right;
        this->left = left;
        this->value = value;
    }
};

And I need to declare a private variable of type Node inside the Node class itself.

Is there any way to do this?

Source: Windows Questions C++

LEAVE A COMMENT