Little problem with sizeof on PC

Noam Mendelson c60b-1eq at e260-1g.berkeley.edu
Wed Apr 24 13:17:00 AEST 1991


In article <REARL.91Apr23040230 at nutrimat.gnu.ai.mit.edu> rearl at gnu.ai.mit.edu (Robert Earl) writes:
>In article <1991Apr23.050747.19705 at agate.berkeley.edu> c60b-1eq at e260-1d.berkeley.edu (Noam Mendelson) writes:
>|   In article <1991Apr23.022057.29511 at ux1.cso.uiuc.edu> allender at ux1.cso.uiuc.edu (Mark Allender) writes:
>|   The best thing would be to restructure the data file, using 202 byte blocks
>|   instead of 201 to be on the safe side.  At worst, you're increasing the
>|   size of the data file by about .5%.
>If it were just a data file, the best thing would be to make it a
>plain text file and use fscanf() or fgets(), but he appears to want
>only the header bit of it, so he should just be very careful to note
>this binary representation could break under another operating
>system/CPU/phase of the moon.

If you want to take up disk space unnecessarily and decrease program
performance, sure, you can create ASCII data files.  Portability will
be limited to the Intel 80x86 line, however, if you opt to use the
binary method.

-- 
+==========================================================================+
| Noam Mendelson   ..!ucbvax!web!c60b-1eq       | "I haven't lost my mind, |
| c60b-1eq at web.Berkeley.EDU                     |  it's backed up on tape  |
| University of California at Berkeley          |  somewhere."             |



More information about the Comp.lang.c mailing list