Compiler outputting wrong size

Pages: 123
> Also why can I add a variable to candybox without its value increasing?
> Can more then 1 variable be in the 8 byte box?

You already have the information that is needed to examine the layout of candy_box (on your implementation) under various scenarios. Use it.
Alright here is my drawing for

"why can I add a variable to candybox without its value increasing?"

Is this how it would look like?

http://i40.tinypic.com/14lhwdt.png

And for number 2, I would say yes, because the alignment of long double as you said depending on the implementation could be 4 while the size is 12, which means the variable is bigger then the size.

Wouldn't that be inefficient cause the processor would have to go 3 times to get all the memory into the registers.

Please reply JLBorges!
When

JLBorges wrote:
You already have the information that is needed to examine the layout of candy_box (on your implementation) under various scenarios. Use it.


was written you were not intended to guess what the implementation would look like and seek input on your guess. Rather you should use the tools that have been mentioned in this thread to determine the actual layout of candy_box on your implementation.

Please do so instead of saying "Here's my guess! Am I right? Please reply!"
Alright I shall
Topic archived. No new replies allowed.
Pages: 123