Sizeof question

lijowski@cosray2.wustl.edu
19 Jan 1999 16:20:41 -0000


Below are two short programs illustrating my question.
The first program when compiled with gcc under SunOS5.5
returns 12 for the size of the structure, what I expect.

void main()

{
struct test_struct {
float a;
float b;
float c;
} test;

printf(" size of test_struct %d\n", sizeof(struct test_struct));
}

The ROOT version of the first program

void Test_sizeof()

{
struct test_struct {
Float_t a;
Float_t b;
Float_t c;
} test;

printf(" size of test_struct %d\n", sizeof(struct test_struct));
}
returns 16.

Why is that?

Thanks and regards.

Michal Lijowski

------------------------------------------------------------------------
Michal Lijowski Washington University
Research Associate St. Louis, MO 63130-4899, USA
Department of Physics phone: 314-935-6285
Campus Box 1105 email: lijowski@cosray2.wustl.edu
------------------------------------------------------------------------