Click here to Skip to main content
15,897,334 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: error Pin
Ryan Binns5-Jul-03 23:55
Ryan Binns5-Jul-03 23:55 
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 
Thanks, peterchen buddy!

I have a further question, for packing value 8.

struct foo
{
char c;
int count;
};

as you said, c will start at address "this", following 3 bytes padding
and 4 bytes for allocation of "count". I want to know why the allocation
is not like this? Allocate 1 bytes for c, then padding 7 bytes, then allocate 4 bytes for "count", then allocate 4 bytes padding to meet 8-byte alignment.

I want to know how to calculate the padding result of a specific struct.


regards,
George
GeneralRe: Question about #pragma pack(1) Pin
peterchen6-Jul-03 21:36
peterchen6-Jul-03 21:36 
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 

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.