0

How to link data using pointers??

😊😊

8th Nov 2016, 8:14 PM
Sai Shankar Sahoo
Sai Shankar Sahoo - avatar
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
9th Nov 2016, 2:36 PM
Burey
Burey - avatar
+ 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.
9th Nov 2016, 1:44 AM
kamal joshi
kamal joshi - avatar