In
#include <iostream>
using namespace std;
struct node
{
int data;
node *next;
};
What does node *next ;
mean?
In
#include <iostream>
using namespace std;
struct node
{
int data;
node *next;
};
What does node *next ;
mean?
It means that the struct
called node
has an element called next
that is of the type "pointer to node
". In a linked list, such an element is typically used to point to the next entry in the linked list.