C help wanted

Dave Sherman dave at utcsrgv.UUCP
Wed Nov 7 11:35:16 AEST 1984


In article <19300024 at uiucdcsb.UUCP> becker at uiucdcsb.UUCP (Craig Becker) writes:
~| 
~|  i have a program that generates a rather complex model of an object
~| (this is for computer graphics) that is composed of records. each record
~| contains data and pointers to other records. this entire data structure
~| is irregular. how can i save this structure in a file so that it can
~| be used by another program? keep in mind that this structure is not
~| tree-like in any way; it more closely resembles something a spider did
~| under influence of drugs.

Store all the data in structures declared in consecutive locations
in memory, and save it in a file with a single write(2) call with address
beginning at the start of all the records, and a size large enough to cover
all the data. Read it in the same way. It's cheating, but it works.

Dave Sherman
Toronto
-- 
 { allegra cornell decvax ihnp4 linus utzoo }!utcsrgv!dave



More information about the Comp.unix mailing list