Click here to Skip to main content
15,886,137 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMetaFiles Pin
popo843-Aug-05 22:31
popo843-Aug-05 22:31 
GeneralRe: MetaFiles Pin
badal_akr4-Aug-05 0:33
badal_akr4-Aug-05 0:33 
QuestionStructure Alignment? Pin
badal_akr3-Aug-05 22:29
badal_akr3-Aug-05 22:29 
AnswerRe: Structure Alignment? Pin
Halawlaws3-Aug-05 23:08
Halawlaws3-Aug-05 23:08 
AnswerRe: Structure Alignment? Pin
Halawlaws3-Aug-05 23:10
Halawlaws3-Aug-05 23:10 
GeneralRe: Structure Alignment? Pin
badal_akr4-Aug-05 0:41
badal_akr4-Aug-05 0:41 
GeneralRe: Structure Alignment? Pin
Blake Miller4-Aug-05 5:04
Blake Miller4-Aug-05 5:04 
GeneralRe: Structure Alignment? Pin
GKarRacer5-Aug-05 9:38
GKarRacer5-Aug-05 9:38 
Generally the default structure alignment (which you should use unless there is a compelling reason not to) is 8 bytes. This aligns all basic data types (up to doubles) to even multiples of their size.

Example (using 8 byte alignment):

struct test
{
    char    a;
    int     b;
    WORD    c;
    char    d;
    double  e;
};


The offset addresses are:

a = 0
b = 4
c = 8
d = 10
e = 16

Total size of the structure: 24 bytes

Notice there is some wasted space in there. You can add some variables to this and not increase the size of the structure at all. The following structure is still 24 bytes in size, but is now fully packed.

struct test2
{
    char    a;
    char    a2;
    WORD    a3;
    int     b;
    WORD    c;
    char    d;
    char    d2;
    int     d3;
    double  e;
};

Generalproblems while assigning CString object. Pin
a_david1233-Aug-05 22:03
a_david1233-Aug-05 22:03 
GeneralRe: problems while assigning CString object. Pin
toxcct3-Aug-05 22:11
toxcct3-Aug-05 22:11 
GeneralRe: problems while assigning CString object. Pin
Eytukan3-Aug-05 23:46
Eytukan3-Aug-05 23:46 
GeneralClose Open Windows with Escape-Key Pin
Daniel Gerstner3-Aug-05 21:38
Daniel Gerstner3-Aug-05 21:38 
GeneralRe: Close Open Windows with Escape-Key Pin
Daniel Gerstner3-Aug-05 23:01
Daniel Gerstner3-Aug-05 23:01 
GeneralRe: Close Open Windows with Escape-Key Pin
Blake Miller4-Aug-05 5:06
Blake Miller4-Aug-05 5:06 
GeneralRe: Close Open Windows with Escape-Key Pin
Daniel Gerstner4-Aug-05 19:02
Daniel Gerstner4-Aug-05 19:02 
GeneralRe: Close Open Windows with Escape-Key Pin
Blake Miller5-Aug-05 6:04
Blake Miller5-Aug-05 6:04 
QuestionHow to Do printing Activexcontol Pin
sjsankar3-Aug-05 21:37
sjsankar3-Aug-05 21:37 
GeneralObject oriented software metrics Pin
ilgale3-Aug-05 21:21
ilgale3-Aug-05 21:21 
QuestionThe Command Line paramters passed to other processes? Pin
Julien3-Aug-05 19:47
Julien3-Aug-05 19:47 
AnswerRe: The Command Line paramters passed to other processes? Pin
Garth J Lancaster3-Aug-05 21:24
professionalGarth J Lancaster3-Aug-05 21:24 
GeneralSample source code for TCP programming Pin
Member 21610043-Aug-05 19:37
Member 21610043-Aug-05 19:37 
GeneralRe: Sample source code for TCP programming Pin
Abebe3-Aug-05 20:23
Abebe3-Aug-05 20:23 
GeneralRe: Sample source code for TCP programming Pin
markkuk4-Aug-05 0:30
markkuk4-Aug-05 0:30 
GeneralRe: Sample source code for TCP programming Pin
Member 21610044-Aug-05 17:21
Member 21610044-Aug-05 17:21 
GeneralPlz help writing a program running background Pin
chiyinhk3-Aug-05 18:32
chiyinhk3-Aug-05 18:32 

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.