From: "Campbell, Rolf [SKY:1U32:EXCH]" Newsgroups: comp.os.msdos.djgpp Subject: Re: How do I set up predefined structures? Date: Tue, 10 Aug 1999 13:38:47 -0400 Organization: Nortel Networks Lines: 36 Message-ID: <37B063A7.8D159653@americasm01.nt.com> References: <7oo1aa$cmh$1 AT news7 DOT svr DOT pol DOT co DOT uk> NNTP-Posting-Host: bmerhc00.ca.nortel.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.7 [en] (X11; I; HP-UX B.10.20 9000/712) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Andrew Davidson wrote: > typedef struct rom_double { > char *file1,*file2; > int length; > } > > typedef struct rom_triple { > char *file1,*file2,*file3; > int length; > }; > > struct rom_map { > rom_double *program_roms; > rom_triple *tile_roms; > rom_double *sprite_roms; > }; > > As an example of a simple predefined structure: > > struct rom_map game1_map = { > { /* program roms */ > {"progrom1a","progrom1b",65536}, > {"progrom2a","progrom2b",65536}, > {NULL, NULL, 0} > }, > The problem arrises because your members of the rom_map struct are POINTERS and your initializing them with values, not addresses. -- -Rolf Campbell (39)3-6318