Date: Wed, 13 Oct 1999 12:00:43 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Viktor Bresan cc: djgpp AT delorie DOT com Subject: Re: Probably newbie question (fread) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 12 Oct 1999, Viktor Bresan wrote: > fread (in which I read in complete struct) doesn't act as I expect. It is usually a good idea to explain what you expect it to do and what it actually does. Don't leave this to our guesswork, because more often than not we will guess wrong. > What causes two different behaviors in this program? > Should I avoid filling complete structs with one fread? See section 22.10 of the DJGPP FAQ, it might give a hint. If the struct was written with a program compiled with another compiler, then you cannot read it in one call to fread due to alignment. You need to read each struct member individually.