Hi everyone,
I need the code to reading from a file into a dynamic structure like a list.
Any help offered is much appreciated.
Thanks
Hi everyone,
I need the code to reading from a file into a dynamic structure like a list.
Any help offered is much appreciated.
Thanks
i suppose you wanna know something about reading from files. have a look at:
http://www.acm.uiuc.edu/webmonkeys/b...uide/2.12.html
puting that stuff into the struct depends on the struct. for more information be more specific.
stormbringer
Two ways to go about it.
First is to read a record, allocate more memory, copy data to new record, repeat until EOF.
Second is find file size (GetFileSize() or fseek() with ftell() ), allocate memory for whole file, read file and copy data until EOF. If using this method check file size by [ Total_File_Size % sizeof(STRUCT) == 0 ] to ensure good file size.
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill