node* head = init_node(5);
cout << "Initial List Contents: " << report(head) << endl; // should be '5'
// append a number
append_data(&head, 42);
cout << "After adding 42: " << report(head) << endl; // should be '42'
// append a few more
append_data(&head, 32);
append_data(&head, 99);
cout << "Should be 42, 32, 99: " << report(head) << endl;
It should say "should be 5 42 33 99:" instead of what is written there.
node* head = init_node(5); cout << "Initial List Contents: " << report(head) << endl; // should be '5' // append a number append_data(&head, 42); cout << "After adding 42: " << report(head) << endl; // should be '42' // append a few more append_data(&head, 32); append_data(&head, 99); cout << "Should be 42, 32, 99: " << report(head) << endl;
It should say "should be 5 42 33 99:" instead of what is written there.