Xref: utzoo comp.lang.c++:13199 comp.lang.c:38933 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!ns-mx!ccad.uiowa.edu!cadsi From: cadsi@ccad.uiowa.edu (CADSI) Newsgroups: comp.lang.c++,comp.lang.c Subject: Re: 64 bit architectures and C/C++ Message-ID: <1991May2.053551.21176@ccad.uiowa.edu> Date: 2 May 91 05:35:51 GMT References: <1991May01.172042.5214@buster.stafford.tx.us> Organization: CAD-Research, U. of Iowa, Iowa City, Iowa Lines: 24 From article <1991May01.172042.5214@buster.stafford.tx.us>, by rli@buster.stafford.tx.us (Buster Irby): > turk@Apple.COM (Ken "Turk" Turkowski) writes: > >>It is necessary to have 8, 16, and 32-bit data types, in order to be able >>to read data from files. I would suggest NOT specifying a size for the int >>data type; this is supposed to be the most efficient integral data type >>for a particular machine and compiler. > > You assume a lot about the data in the file. Is it stored in a specific > processor format (ala Intel vs Motorolla)? My experience has been that > binary data is not portable anyway. Binary isn't in general portable. However, using proper typedefs in a class one can move binary read/write classes from box to box. I think the solution the the whole issue of sizeof(whatever) is to simply assume nothing. Always typedef. It isn't that difficult, and code I've done this runs on things ranging from DOS machines to CRAY's COS (and UNICOS) without code (barring the typedef header files) changes. |----------------------------------------------------------------------------| |Tom Hite | The views expressed by me | |Manager, Product development | are mine, not necessarily | |CADSI (Computer Aided Design Software Inc. | the views of CADSI. | |----------------------------------------------------------------------------|