Click here to Skip to main content
16,011,170 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: error Pin
Michael Dunn6-Jul-03 2:59
sitebuilderMichael Dunn6-Jul-03 2:59 
GeneralQuestion about #pragma pack(1) Pin
George25-Jul-03 21:46
George25-Jul-03 21:46 
GeneralRe: Question about #pragma pack(1) Pin
Rick York5-Jul-03 22:03
mveRick York5-Jul-03 22:03 
GeneralRe: Question about #pragma pack(1) Pin
George25-Jul-03 22:12
George25-Jul-03 22:12 
GeneralRe: Question about #pragma pack(1) Pin
peterchen5-Jul-03 22:18
peterchen5-Jul-03 22:18 
GeneralRe: Question about #pragma pack(1) Pin
peterchen5-Jul-03 22:16
peterchen5-Jul-03 22:16 
GeneralRe: Question about #pragma pack(1) Pin
George26-Jul-03 17:10
George26-Jul-03 17:10 
GeneralRe: Question about #pragma pack(1) Pin
peterchen6-Jul-03 21:36
peterchen6-Jul-03 21:36 
because int /being 4 bytes) needs to be only on an multiple-of-4 address
I'll give you some examples, with the compiler-added pad bytes named __pad:

struct {
  char a;
  char b;    // byte - no padding needed
  __pad[2];  // pad the int to a multiple of 4
  int x;
};

struct {
  char a;
  char b;    
  __pad[6];  // pad the double (8 byte) to a multiple of 8
  double x;
};

struct {
  double x;
  char a;
  char b;    
  __pad[6];   // struct contains an 8 byte member, so pad size to n*8 bytes
};

struct {
  int x;
  int y;
  char a;
  char b;    
  __pad[2];   // biggest memebr struct contains is 4 byte ==> pad size to n*4 bytes
};


fun, isn't it? Roll eyes | :rolleyes:


"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS

sighist | Agile Programming | doxygen

GeneralRe: Question about #pragma pack(1) Pin
George26-Jul-03 21:57
George26-Jul-03 21:57 
GeneralRe: Question about #pragma pack(1) Pin
peterchen6-Jul-03 22:26
peterchen6-Jul-03 22:26 
GeneralRe: Question about #pragma pack(1) Pin
George26-Jul-03 22:51
George26-Jul-03 22:51 
GeneralRe: Question about #pragma pack(1) Pin
peterchen7-Jul-03 1:15
peterchen7-Jul-03 1:15 
GeneralHexadecimal representation Pin
punkms15-Jul-03 20:46
punkms15-Jul-03 20:46 
GeneralRe: Hexadecimal representation Pin
Rick York5-Jul-03 21:31
mveRick York5-Jul-03 21:31 
GeneralRe: Hexadecimal representation Pin
Ryan Binns5-Jul-03 22:05
Ryan Binns5-Jul-03 22:05 
GeneralRe: Hexadecimal representation Pin
peterchen5-Jul-03 22:21
peterchen5-Jul-03 22:21 
GeneralRe: Hexadecimal representation Pin
Ryan Binns5-Jul-03 22:31
Ryan Binns5-Jul-03 22:31 
GeneralRe: Hexadecimal representation Pin
peterchen6-Jul-03 21:41
peterchen6-Jul-03 21:41 
GeneralRe: Hexadecimal representation Pin
Ryan Binns6-Jul-03 22:27
Ryan Binns6-Jul-03 22:27 
GeneralRe: Hexadecimal representation Pin
Rick York5-Jul-03 22:32
mveRick York5-Jul-03 22:32 
GeneralRe: Hexadecimal representation Pin
peterchen5-Jul-03 21:42
peterchen5-Jul-03 21:42 
GeneralRe: Hexadecimal representation Pin
punkms15-Jul-03 22:04
punkms15-Jul-03 22:04 
GeneralRe: Hexadecimal representation Pin
peterchen5-Jul-03 22:32
peterchen5-Jul-03 22:32 
GeneralPersisting MFC dialog's object properties Pin
haritadala5-Jul-03 18:40
haritadala5-Jul-03 18:40 
GeneralRe: Persisting MFC dialog's object properties Pin
Ryan Binns5-Jul-03 20:22
Ryan Binns5-Jul-03 20:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.