Click to See Complete Forum and Search --> : how can i load from a file information in a tree structure..


jasie24
January 11th, 2003, 02:45 PM
how can i load information from a file into a tree structure.
suppose i had save it before in a file(only the information)

for example if i have a structure of a tree like this:

typedef int tip;

struct node{
tip info;
int ns;
nod* son[20];
};

so, only the info filed i have saved if i cross the tree in depth.

i'll b grateful to everyone who would help me.
thanks

filthy_mcnasty
January 11th, 2003, 02:53 PM
GetFileAttributes()?

i dont really understand what you mean about get info from the file.

kuphryn
January 12th, 2003, 12:35 PM
Consider outputting the entire container to a file in binary mode. Reading it back is the same.

Kuphryn

jasie24
January 12th, 2003, 03:30 PM
Originally posted by filthy_mcnasty
GetFileAttributes()?

i dont really understand what you mean about get info from the file.
i ment after you work on a binary tree you save the information from that tree(the structure has a field named "info" for example,which can b a number,or a string whatever) and that information i save it before qiuting the program because i want to reconstruct the tree with that information saved from that file i was talking about.now you get the ideea .if yes maybe you can give ideeas.thks