Sizeof question

From: lijowski@cosray2.wustl.edu
Date: Tue Jan 19 1999 - 17:20:41 MET


  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
------------------------------------------------------------------------



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:28 MET