Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!ncar!gatech!hubcap!grimlok From: grimlok@hubcap.clemson.edu (Mike Percy) Newsgroups: comp.lang.c Subject: Re: Little problem with sizeof on PC Message-ID: <1991Apr25.145500.3199@hubcap.clemson.edu> Date: 25 Apr 91 14:55:00 GMT References: <1991Apr24.031700.17233@agate.berkeley.edu> <1991Apr24.212513.25621@agate.berkeley.edu> Organization: Clemson University Lines: 47 c60b-1eq@web-4e.berkeley.edu (Noam Mendelson) writes: >In article enag@ifi.uio.no (Erik Naggum) writes: >>In article <1991Apr24.031700.17233@agate.berkeley.edu>, Noam Mendelson writes: >> >> 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. >> >>If you want to take up debugging time unnecessarily and decrease >>programmer performance, sure, you can create binary data files. If I dump structs out to disk and read them back in later, it is a lot less error prone than coding a bunch of fscanf() calls (which have their own problems). >Decrease programmer performance? Read()'ing in the data structure >causes a lot less headache than trying to fscanf() in the data >from an ASCII data file. Unless, of course, you need to try to figure out what's wrong with the program by examining the data files. But I assume that when I write a struct to a binary file, I can read it back into the struct. If not, then my compiler has done me serious wrong... >>Portability and debug-ability will be be unlimited, however, if you > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >>opt to use the readable data file method. >So I assume you've never had any problems doing I/O on ASCII files. >ASCII data files produce a whole new set of problems that don't exist >with the binary format, ranging from the fscanf() syntax to the >record size. I sure have. >Portability will be dramatically increased, although not unlimited. I suppose protability of the _program_ would be unaffected either way. The _data_files_, on the other hand, would tend to have problems. "I don't know about your brain, but mine is really...bossy." Mike Percy grimlok@hubcap.clemson.edu ISD, Clemson University mspercy@clemson.BITNET (803)656-3780 mspercy@clemson.clemson.edu