Sebgg

l2y3

Nov 13th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. struct Node
  2. {
  3.   Node(int value = 0, Node* n = nullptr)
  4.     : value{value}, next{n}
  5.   {}
  6.  
  7.   int value;
  8.   Node* next;
  9. };
  10.  
  11. int main()
  12. {
  13.   Node* first{new Node{5}};
  14.   first->next = new Node{9};
  15.   std::cout << first->value << std::endl;
  16.   std::cout << first->next->value << std::endl;
  17. }
Add Comment
Please, Sign In to add comment