Click here to Skip to main content
15,894,825 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: How to get body of new arrived mail? [modified] Pin
Programm3r1-Mar-07 20:27
Programm3r1-Mar-07 20:27 
AnswerRe: How to get body of new arrived mail? Pin
Shashi Shinde1-Mar-07 20:55
Shashi Shinde1-Mar-07 20:55 
GeneralRe: How to get body of new arrived mail? Pin
Programm3r1-Mar-07 21:00
Programm3r1-Mar-07 21:00 
GeneralRe: How to get body of new arrived mail? Pin
Shashi Shinde1-Mar-07 22:14
Shashi Shinde1-Mar-07 22:14 
GeneralRe: How to get body of new arrived mail? Pin
Programm3r1-Mar-07 22:34
Programm3r1-Mar-07 22:34 
GeneralRe: How to get body of new arrived mail? Pin
Shashi Shinde2-Mar-07 2:50
Shashi Shinde2-Mar-07 2:50 
Questionsizeof() Operator Pin
Bulky Fellow1-Mar-07 18:30
Bulky Fellow1-Mar-07 18:30 
AnswerRe: sizeof() Operator [modified] Pin
Naveen1-Mar-07 19:07
Naveen1-Mar-07 19:07 
In vc++ there is something call structure memeber alignment . Suppose the member alignment value is 4, Then the structure will be having a allocation size of 4 byte. Let me tell you how the struct a become 16 in your case.

first element is char c1. Since the member alignment value is 4, 4 byte will be allocated. So a remaining 3.

Second member i1 is int. Int takes 4 byte. So it will not fit in the previous 3 bytes. Hence it will allocate a new 4 bytes

and so on.. The 16 bytes is occupied as follows

1 - c1
2 - Free
3 - Free
4 - Free
5 - i1
6 - i1
7 - i1
8 - i1
9 - c2
10 - Free
11 - Free
12 - Free
13 - i2
14 - i2
15 - i2
16 - i2

you can change the member alignment setting of the project by changing the /Zp option in the compile setting ( project menu-> setting->C++-> Take Code egenration in the category menu. Now u can find a combobox "Struct member alignment")

You can also change the settings as by putting the Pragma Directives.

#pragma pack( push , 1 )//change the member alignment value to 1<br />
struct{<br />
char c1;       <br />
int i1;<br />
char c2;<br />
int i2;}a;<br />
#pragma pack(pop)






-- modified at 1:14 Friday 2nd March, 2007

nave

AnswerRe: sizeof() Operator Pin
Mark Salsbery1-Mar-07 19:10
Mark Salsbery1-Mar-07 19:10 
QuestionMore problem Pin
Kiethnt1-Mar-07 17:28
Kiethnt1-Mar-07 17:28 
AnswerRe: More problem Pin
Hamid_RT1-Mar-07 17:56
Hamid_RT1-Mar-07 17:56 
AnswerRe: More problem Pin
John R. Shaw2-Mar-07 21:39
John R. Shaw2-Mar-07 21:39 
Questioncomplete Pin
Kiethnt1-Mar-07 17:25
Kiethnt1-Mar-07 17:25 
AnswerRe: complete Pin
Cedric Moonen1-Mar-07 20:05
Cedric Moonen1-Mar-07 20:05 
QuestionC++ to DSP Pin
apoc831-Mar-07 14:28
apoc831-Mar-07 14:28 
AnswerRe: C++ to DSP Pin
Cedric Moonen1-Mar-07 20:07
Cedric Moonen1-Mar-07 20:07 
GeneralRe: C++ to DSP Pin
apoc831-Mar-07 20:26
apoc831-Mar-07 20:26 
QuestionProblem using CStrings in a linked list (memory leak) Pin
CoffeeAddict191-Mar-07 10:25
CoffeeAddict191-Mar-07 10:25 
AnswerRe: Problem using CStrings in a linked list (memory leak) Pin
Mark Salsbery1-Mar-07 10:57
Mark Salsbery1-Mar-07 10:57 
AnswerRe: Problem using CStrings in a linked list (memory leak) Pin
led mike1-Mar-07 11:30
led mike1-Mar-07 11:30 
GeneralRe: Problem using CStrings in a linked list (memory leak) Pin
Nibu babu thomas1-Mar-07 16:20
Nibu babu thomas1-Mar-07 16:20 
AnswerRe: Problem using CStrings in a linked list (memory leak) Pin
prasad_som1-Mar-07 20:00
prasad_som1-Mar-07 20:00 
Questiongenerating reports Pin
namratab1-Mar-07 8:51
namratab1-Mar-07 8:51 
AnswerRe: generating reports Pin
Anders Gustafsson1-Mar-07 9:18
Anders Gustafsson1-Mar-07 9:18 
GeneralRe: generating reports Pin
namratab1-Mar-07 9:34
namratab1-Mar-07 9:34 

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.