Maddening Linked List problem
- by Mike
This has been plaguing me for weeks. It's something really simple, I know it. Every time I print a singly linked list, it prints an address at the end of the list.
#include <iostream>
using namespace std;
struct node
{
int info;
node *link;
};
node *before(node *head);
node *after(node *head);
void middle(node *head, node *ptr);
void…