Code:
struct Record
{
char own_name[20];
int score_own;
char opp_name[20];
int score_opp;
char result[2];
int wins;
int losses;
int ties;
struct Record *next;
};
struct Team
{ char team_name[20];
struct Record record_link;
struct Team *left;
struct Team *right;
struct Team *top;
}root;
I have above two structures, The structure Team have an structure Record included. Stucture Team is an binary Tree. For every node in Structure Team of record_link, is a link_list.
When I linking the code I found:
root->record_link=root->record_link->next is not correct.
So my question is how to visit the data of record_link through the tree?
For example:
Code:
while(root->record_link->next!=NULL)
{
fprintf(fp2,"%s %d-%d %s\n",root->record_link.result,root- >record_link.score_own,root->record_link.score_opp,root->record_link.opp_name);
root->record_link=root->record_link->next;
}
is not valid. How to visit each member of their value?
Thanks