Date: Wed, 31 Dec 1997 09:54:45 +0200 (IST) From: Eli Zaretskii To: Dave Nugent cc: djgpp AT delorie DOT com Subject: Re: Why does DJGPP's getw not read Borlands getw? In-Reply-To: <34A96539.424E@ns.sympatico.ca> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 30 Dec 1997, Dave Nugent wrote: > Can someone explain to me why I have a file that was created in Borlands > Turbo C++ v3.0 that wrote a bunch of integers can't be read properly in > DJGPP? An int is 16 bit in Borland C, but DJGPP uses 32-bit ints, that's why. Use short in DJGPP to get a 16-bit int. Note that it is usually a *very* bad idea to share binary data between different compilers, as they have their private trick of laying out data in memory. The speed gain in reading binary data is IMHO not worth the hassle you get to make code that reads binary data work with another compiler. Make your files ASCII and live happily ever after.