Click here to Skip to main content
15,914,444 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Arranging files Pin
deeps_cute3-Apr-07 17:38
deeps_cute3-Apr-07 17:38 
GeneralRe: Arranging files Pin
Naveen3-Apr-07 17:48
Naveen3-Apr-07 17:48 
GeneralRe: Arranging files Pin
deeps_cute3-Apr-07 18:10
deeps_cute3-Apr-07 18:10 
GeneralRe: Arranging files Pin
Naveen3-Apr-07 18:20
Naveen3-Apr-07 18:20 
GeneralRe: Arranging files Pin
deeps_cute3-Apr-07 20:17
deeps_cute3-Apr-07 20:17 
AnswerRe: Arranging files Pin
ThatsAlok18-Apr-07 21:07
ThatsAlok18-Apr-07 21:07 
QuestionImporting MSWORD Pin
N a v a n e e t h3-Apr-07 17:07
N a v a n e e t h3-Apr-07 17:07 
Questionmemory alignment of a struct Pin
George_George3-Apr-07 17:04
George_George3-Apr-07 17:04 
Hello everyone,


I heard when define a struct, it is important to make the size of the struct memory aligned.

For example,

<br />
struct foo<br />
{<br />
    char p;<br />
    char[3] align;<br />
};<br />


<br />
struct goo<br />
{<br />
    char p;<br />
};<br />


struct foo is better than struct goo, even if we only use member p.

Allocate 3 bytes to align with memory. But I do not know why make memory aligned is better. Any reasons? (for example, prevent memory from running out?)


thanks in advance,
George
AnswerRe: memory alignment of a struct Pin
Michael Dunn3-Apr-07 17:17
sitebuilderMichael Dunn3-Apr-07 17:17 
GeneralRe: memory alignment of a struct Pin
George_George3-Apr-07 20:37
George_George3-Apr-07 20:37 
AnswerRe: memory alignment of a struct Pin
Nibu babu thomas3-Apr-07 19:48
Nibu babu thomas3-Apr-07 19:48 
GeneralRe: memory alignment of a struct Pin
George_George3-Apr-07 20:44
George_George3-Apr-07 20:44 
GeneralRe: memory alignment of a struct Pin
Nibu babu thomas3-Apr-07 20:59
Nibu babu thomas3-Apr-07 20:59 
GeneralRe: memory alignment of a struct Pin
George_George3-Apr-07 21:17
George_George3-Apr-07 21:17 
GeneralRe: memory alignment of a struct Pin
Nibu babu thomas4-Apr-07 0:39
Nibu babu thomas4-Apr-07 0:39 
QuestionFindNextPrinterChangeNotification fails [modified] Pin
bios80863-Apr-07 16:23
bios80863-Apr-07 16:23 
Questionhow to get motherboard's serial with VC6.0? Pin
sun_shb3-Apr-07 15:23
sun_shb3-Apr-07 15:23 
AnswerRe: how to get motherboard's serial with VC6.0? Pin
Mark Salsbery3-Apr-07 15:51
Mark Salsbery3-Apr-07 15:51 
GeneralRe: how to get motherboard's serial with VC6.0? Pin
sun_shb3-Apr-07 15:55
sun_shb3-Apr-07 15:55 
GeneralRe: how to get motherboard's serial with VC6.0? Pin
Mark Salsbery3-Apr-07 16:05
Mark Salsbery3-Apr-07 16:05 
AnswerRe: how to get motherboard's serial with VC6.0? Pin
Hamid_RT3-Apr-07 18:42
Hamid_RT3-Apr-07 18:42 
AnswerRe: how to get motherboard's serial with VC6.0? Pin
ThatsAlok18-Apr-07 21:05
ThatsAlok18-Apr-07 21:05 
Questionsocket program help Pin
mhetfield19783-Apr-07 15:13
mhetfield19783-Apr-07 15:13 
GeneralRe: socket program help Pin
Mila0253-Apr-07 21:37
Mila0253-Apr-07 21:37 
AnswerRe: socket program help Pin
Moak4-Apr-07 4:38
Moak4-Apr-07 4:38 

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.