View difference between Paste ID: 47hwCD4q and vhKm4mfD
SHOW: | | - or go back to the newest paste.
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
}