Click here to Skip to main content
15,911,315 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: the "Decimal" data type in vc++ Pin
Nemanja Trifunovic5-Mar-10 8:25
Nemanja Trifunovic5-Mar-10 8:25 
GeneralRe: the "Decimal" data type in vc++ [modified] Pin
bob1697217-Mar-10 15:39
bob1697217-Mar-10 15:39 
AnswerRe: the "Decimal" data type in vc++ Pin
Alain Rist5-Mar-10 9:52
Alain Rist5-Mar-10 9:52 
QuestionCstring to char Pin
johnalek5-Mar-10 7:03
johnalek5-Mar-10 7:03 
AnswerRe: Cstring to char Pin
Chris Losinger5-Mar-10 7:17
professionalChris Losinger5-Mar-10 7:17 
AnswerRe: Cstring to char Pin
Rajesh R Subramanian5-Mar-10 7:40
professionalRajesh R Subramanian5-Mar-10 7:40 
Questionvector in space Pin
khomeyni5-Mar-10 7:03
khomeyni5-Mar-10 7:03 
AnswerRe: vector in space PinPopular
Chris Losinger5-Mar-10 7:21
professionalChris Losinger5-Mar-10 7:21 
GeneralRe: vector in space Pin
khomeyni5-Mar-10 17:04
khomeyni5-Mar-10 17:04 
QuestionHow could I change the CMFCPropertyGridCtrl Property or value column width Pin
A&Ms5-Mar-10 6:49
A&Ms5-Mar-10 6:49 
AnswerRe: How could I change the CMFCPropertyGridCtrl Property or value column width Pin
jung-kreidler11-Sep-11 20:36
jung-kreidler11-Sep-11 20:36 
GeneralRe: How could I change the CMFCPropertyGridCtrl Property or value column width Pin
Martial Spirit15-Jul-21 22:55
Martial Spirit15-Jul-21 22:55 
Questionatof doesn't convert exactly [Solved] Pin
b-rad3115-Mar-10 6:17
b-rad3115-Mar-10 6:17 
AnswerRe: atof doesn't convert exactly PinPopular
Luc Pattyn5-Mar-10 6:31
sitebuilderLuc Pattyn5-Mar-10 6:31 
QuestionHow to add Messsage After installling Application using MSI Pin
am 20095-Mar-10 3:53
am 20095-Mar-10 3:53 
AnswerRe: How to add Messsage After installling Application using MSI Pin
Richard Andrew x645-Mar-10 15:31
professionalRichard Andrew x645-Mar-10 15:31 
QuestionStructure/Class member addresses Pin
Mike the Red5-Mar-10 2:58
Mike the Red5-Mar-10 2:58 
AnswerRe: Structure/Class member addresses Pin
CPallini5-Mar-10 3:22
mveCPallini5-Mar-10 3:22 
GeneralThanks, Pallini! -nt- Pin
Mike the Red5-Mar-10 3:43
Mike the Red5-Mar-10 3:43 
AnswerRe: Structure/Class member addresses Pin
Luc Pattyn5-Mar-10 4:12
sitebuilderLuc Pattyn5-Mar-10 4:12 
Mike the Red wrote:
Is the order of the members in memory the same as the order in which they are declared?


No, absolutely not. Without additional information, any compiler can do as it pleases, as long as it is consistent. Here are two typical approaches:

1. reorder the items according to element size, possibly reducing struct size: since items want to be "naturally aligned" (i.e. a N-byte quantity starts at an address that is a multiple of N for best performance) it may pay off to put the largest ones first.

2. keep the declaration order and pad with dummy bytes to achieve natural alignment.

Not a single strategy is good for all purposes as one may want compatibility with another language, an existing data structure in a file, a set of registers in a hardware device, etc.

Hence, most compilers have switches and/or pragma's to control the exact behavior. You should read the documentation of your tools.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.

AnswerRe: Structure/Class member addresses Pin
Saurabh.Garg5-Mar-10 4:19
Saurabh.Garg5-Mar-10 4:19 
GeneralRe: Structure/Class member addresses Pin
Luc Pattyn5-Mar-10 4:25
sitebuilderLuc Pattyn5-Mar-10 4:25 
GeneralRe: Structure/Class member addresses Pin
Saurabh.Garg5-Mar-10 4:37
Saurabh.Garg5-Mar-10 4:37 
GeneralRe: Structure/Class member addresses Pin
Luc Pattyn5-Mar-10 4:50
sitebuilderLuc Pattyn5-Mar-10 4:50 
GeneralRe: Structure/Class member addresses Pin
CPallini5-Mar-10 5:26
mveCPallini5-Mar-10 5:26 

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.