[help]:pointers

#ifndef SLLIST_H
#define SLLIST_H

struct Node
{
int info;
Node *link;
};

class SLList
{
public:
SLList();
void addFirst(int x);
void addLast(int x);
bool deleteNode(int x);
void print();

private:
Node *first;
Node *last;
int size;
};

#endif
-------------------------------
what does Node*link mean and how does it work?
This is a pointer to next Node to link all nodes in the list in one long chain.
It a structure pointer , so that we can attach n number of nodes to it ..

Ex: Train

Start with an engine .. then connect the boxes[bogie] how much u need .. connection can be done through link pointer
Topic archived. No new replies allowed.