Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C structs & fread

Name: Anonymous 2007-11-23 2:52

I have a struct i want to read in from file. To be specific its a windows bmp. It works when i read in the values individually, but when I try and read the structure as a whole it gets the wrong values:


struct BITMAPFILEHEADER{
    unsigned short bfType;        // size: 2
    unsigned int bfSize;        // size: 4
    unsigned short bfReserved1;    // size: 2 
    unsigned short bfReserved2;    // size: 2 
    unsigned int bfOffBits;    //size: 4
};

// works
fread (&fileheader.bfType,2,1,imgFile);
fread (&fileheader.bfSize,4,1,imgFile);
fread (&fileheader.bfReserved1,2,1,imgFile);
fread (&fileheader.bfReserved2,2,1,imgFile);
fread (&fileheader.bfOffBits,4,1,imgFile);

// does not work right
fread (&fileheader,sizeof(BITMAPFILEHEADER),1,imgFile);

Name: Anonymous 2007-11-24 18:11

>>39
``learn to see''?

Name: ​​​​​​​​​​ 2010-10-25 12:17

Name: Anonymous 2011-01-31 20:44

<-- check em dubz

Name: Anonymous 2011-02-03 5:50

Name: Anonymous 2013-09-01 16:58


The momentum of set theory was such that debate on the paradoxes did not lead to its abandonment. The work of Zermelo in 1908 and Abraham Fraenkel in 1922 resulted in the set of axioms ZFC, which became the most commonly used set of axioms for set theory. The work of analysts such as Henri Lebesgue demonstrated the great mathematical utility of set theory, which has since become woven into the fabric of modern mathematics. Set theory is commonly used as a foundational system, although in some areas category theory is thought to be a preferred foundation.

Name: Anonymous 2013-09-01 19:15


From this definition, it is clear that a set is a subset of itself; for cases where one wishes to rule out this, the term proper subset is defined. A is called a proper subset of B if and only if A is a subset of B, but B is not a subset of A.

Name: Anonymous 2013-09-01 20:14



   /i
  .| |
  | |
 .| |
 | |    __ノ ̄i. __,,,.........,,,__
 | |    ) ヽ、_ゝ-        `ヽ、
 | |    `y'"        `ヽ、 ヽ,
 .| |.    イ / / ⌒/ i  i⌒', ',   ',
 .| |    Lハ__L/ i__ハ__ハ___i .l   i
  | |.     ノ iT!'j   <  ト-┘  |
  .i i     ´7〈""  r─,  ""|   ノ  ..:::::::...
  l l__   く__,iゝ、_ ヽノ  ,.イ_ノ_i^i  ::   ::::::
 ⊂ ̄_ゝ、    `´_'ヽ'ハヘT´_/ヽ-ハ,.ト-、 ::  ::::::
  `! (、 i、  ,γ´ ヘ (ハ)´〒 /(つ   〉:  :::::
   iミiヽ、   ̄)  /  Y 。  i _`T ´|  :::::
   .lミl  ` ̄ ^ーイ  ハ ゚  .ハ"7/  i  :::
   

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List