Read Data-Linked list pro
Hi all, here is the format of the original data file an dlooks like blow:
/* data Format*/
artist1 cdname1
3
song1_1
song1_2
song1_3
artist2 cdname2
4
song2_1
song2_2
song2_3
song2_4
artist3 cdname3
2
song3_1
song3_2
.
.
.
/*and so on...*/
And I've write structure type preparing to do some binary search tree stuff below:
typedef struct dnode
{
char name[41];
}DATA;
typedef struct songnode
{
DATA song;
char time[6];
struct songnode *next;
}SONGNODE, *SONGPTR;
typedef struct cdnode
{
DATA cdname;
SONGPTR songhead;
struct cdnode *cdnext;
}CDNODE, *CDPTR;
typedef struct artist
{
DATA artistname;
CDPTR head;
struct artist *leftchild, *rightchild;
}ARTIST, *ARTISTPTR;
and My question is how can I read data file by using these structures I've defined?
I'm still thinking about it and writing code but i'm really confused
about linked list stuff. I hope any one can help me out!
Thanx very very much for any help!!