c - Creating a structure for linked list -
experts, having simple doubt in linked list , structure. want create list subset. example structure
typedef struct { uint16 a; uint8 b; uint8 c; uint8 d; }subset_t; typedef struct node{ subset_t list; uint8 set_no; struct node *link; }all_list:
but think structure not expect, example there set number 15, in set there should different subset(a,b,c,d).
ex.
set subset 15 a=10; b=1; c=17; d=12 a=00, b=43; c=21; d=15; 10 a=10; b=1; c=17; d=12 a=00, b=43; c=21; d=15;
how can defined structure this?. main reason want create different structure delete of subset easily.
so want like:
typedef struct subset_t { uint16 a; uint8 b; uint8 c; uint8 d; struct subset_t *next; }subset_t; typedef struct node{ subset_t list; uint8 set_no; struct node *link; }all_list:
(note subset_t
added first line). run through node
structures until set_no
1 want. node's list
head of linked-list of subset_t
strucutres next
pointing next in list.
Comments
Post a Comment