Click here to Skip to main content
15,915,864 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPlease fix your reply[OT] Pin
prasad_som1-Mar-07 20:21
prasad_som1-Mar-07 20:21 
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 
The following code is simple console code. Nothing visual or rocket science about it.

Amazingly, the code prints size of A as 16 and size of B as 12. Char is 1 byte, int is
4 bytes. So both structs should be 10bytes each. Can someone please help me understand
why this is not the case? If you don't believe me, run it and see for yourself.

#include <iostream>
using namespace std;

struct
{      
  char c1;     
  int i1;      
  char c2;      
  int i2;
}a; 

struct
{      
  int i1;      
  int i2;      
  char c1;      
  char c2;
}b;

int main()
{	
  cout<<"sizeof struct A " <<sizeof(a);	
  cout<<"sizeof struct B " <<sizeof(b);	
  
  getchar();	
  return(0);
}


Thanks in advance.



ASP - AJAX is SEXY. PERIOD.

AnswerRe: sizeof() Operator [modified] Pin
Naveen1-Mar-07 19:07
Naveen1-Mar-07 19:07 
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 

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.