Re: sizeof error?



Michael R. Copeland <mrc2323@xxxxxxx> wrote:
> [...]
> I have, I believe, a good reason: I am reading (with fread) a binary
> data file into this structure. The data is 6 bytes/record, and I tried
> - unsuccessfully - to use sizeof to specify the size of each read. It
> didn't work until I used a constant value of 6...which isn't the way I
> wanted to use the language. <sigh...>


Look into #pragma pack.

Schobi

--
SpamTrap@xxxxxx is never read
I'm Schobi at suespammers dot org

"Coming back to where you started is not the same as never leaving"
Terry Pratchett


.



Relevant Pages

  • Build read-only file into exe file?
    ... And I use stdio function such as fopento fread() to operate the ... The content of the data file is constant. ... Prev by Date: ...
    (microsoft.public.vc.language)
  • Re: The concept of a record
    ... After reading Gordon and Klaus's replies, ... external data file, I load the data file using fread of matlab. ... fread will produce a data matrix. ...
    (comp.lang.fortran)
  • Re: sizeof error?
    ... data file into this structure. ... The data is 6 bytes/record, ... - unsuccessfully - to use sizeof to specify the size of each read. ...
    (microsoft.public.vc.language)