Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Node
- {
- Node(int value = 0, Node* n = nullptr)
- : value{value}, next{n}
- {}
- int value;
- Node* next;
- };
- int main()
- {
- Node* first{new Node{5}};
- first->next = new Node{9};
- std::cout << first->value << std::endl;
- std::cout << first->next->value << std::endl;
- }
Add Comment
Please, Sign In to add comment