Sunday 27 October 2019

Why do we need pointers in C implementation of a linked list?

Why is it important to use pointers in an implementation of linked lists in C?



For example:



typedef struct item                                     

{
type data;
struct item *next;
} Item;

typedef struct list
Item *head;
} List;



What would happen if Ill use the same implementation just without the pointers?

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...