cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/27/18:01:01

From: leger_v AT bluewin DOT ch
Newsgroups: comp.os.msdos.djgpp
Subject: Problem fread and structures
Date: Fri, 27 Mar 1998 19:32:18 +0100
Organization: Swisscom AG, the blue window
Lines: 17
Message-ID: <351BF0B2.6AC2@bluewin.ch>
NNTP-Posting-Host: sio22pub129.bluewin.ch
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

See this structure : 

struct

{ unsigned x,y,z,a;
  char c;
  char array[10];
  
}samplestruct;

FILE *stream;
Why when I use fread(&samplestruct, sizeof(samplestruct), 1, stream);
The structure samplestruct contains false data. And when I compile my
program whith Borland C++ the program works fine ?

Thanx,
Patrick.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019