Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!att!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.lang.c Subject: forcing struct allignment Message-ID: <9020@chinet.chi.il.us> Date: 20 Jul 89 18:44:48 GMT Reply-To: les@chinet.chi.il.us (Leslie Mikesell) Organization: Chinet - Public Access Unix Lines: 9 I have a program that current writes a variety of different structs into a disk file and maintains the seek offsets to access them as needed. Is there a way to pad them such that the allignment would be correct if the whole file were read into a malloc()ed block of memory or would I still have to memcpy() each struct into a correctly alligned memory block before accessing the members? When each struct is written to the disk, the program does not know the type of the struct that will follow. Les Mikesell