Click here to Skip to main content
15,908,115 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CString problem Pin
John M. Drescher6-Jul-03 4:24
John M. Drescher6-Jul-03 4:24 
GeneralRe: CString problem Pin
andyg.1016-Jul-03 4:36
andyg.1016-Jul-03 4:36 
GeneralRe: CString problem Pin
David Crow7-Jul-03 3:01
David Crow7-Jul-03 3:01 
GeneralRe: CString problem Pin
David Crow7-Jul-03 3:04
David Crow7-Jul-03 3:04 
Generalerror Incorrect Function Pin
andyg.1016-Jul-03 1:36
andyg.1016-Jul-03 1:36 
GeneralRe: error Incorrect Function Pin
andyg.1016-Jul-03 1:44
andyg.1016-Jul-03 1:44 
Questionhow to control networkcard in c/c++! Pin
jobillcai6-Jul-03 0:21
jobillcai6-Jul-03 0:21 
Generalerror Pin
dudic5-Jul-03 23:39
dudic5-Jul-03 23:39 
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 

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.