0
How to link data using pointers??
😊😊
2 odpowiedzi
+ 3
this is called a linked list
where each data structure holds a data and a pointer to the next data structure
[data|>]>>[data|>]>>....
you only need to hold the pointer to the head of the linked list, and to get a value you just jump to the next structure until it is found
google "Linked List C++" for more info
+ 1
data can be linked by creating a structure i.e. node and placing a self referential pointer in it. It is used to link different nodes.
struct node
{
int data;
node *link;
};
Here link pointer is of node type, which is used to point to an object of node type.