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?

void main()
bynarytree *rad;
book a;

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

line 1: its int main() never ever void main()

line 7: feof is a function and it needs to be written as feof()

line 9: why are you using cin to read from a file? cin gets information from the keyboard (YOU type the characters) not from the file.

lines 10 and 11: That is just assigning those from some variables that are already in memory. It is not reading the data from the file at all. You might as well juse use a crystle ball to get the data for that binary tree.

Try calling fgets() to read the information from the file.