I need to create a bynarytree of which information of a node is made of ISBN and price fields, data kept in a structure (book).
I write in a .txt file : ISBN=10 Price=100
ISBN=13 Price =1
how can i populate the bynarytree with this informations, from the file?
example:
void main()
{
bynarytree *rad;
book a;
FILE*f;
f=fopen("books.txt","r+");
while(!feof)
{
cin>>f>>a.ISBN>>a.price;
rad->info.ISBN=a.ISBN;
rad->info.price=a.price;
}
RSD(rad);
fclose(f);
}
my problem is what i write in while to make the link between what i wrote in file and the fields of the structure, because like this is not working.Thanks a lot