structure padding

Discussion in 'C++' started by sharat, Feb 28, 2007.

  1. sharat

    sharat Guest

    hi groups.

    what is structure padding exactly ?how the alignment will done
    exactly?
    example :
    struct ex
    {
    double d1;
    char c1;
    };
    sizeof above structure is 12.why?
    i expected 16.

    can any body explain.

    thanx in advance .
     
    sharat, Feb 28, 2007
    #1
    1. Advertising

  2. sharat

    Ian Collins Guest

    sharat wrote:
    > hi groups.
    >
    > what is structure padding exactly ?how the alignment will done
    > exactly?


    Search the group's archives, this is asked at least once a week.

    --
    Ian Collins.
     
    Ian Collins, Feb 28, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Amarendra

    Structure padding.

    Amarendra, Jun 21, 2004, in forum: C Programming
    Replies:
    13
    Views:
    9,615
    Ralmin
    Jun 22, 2004
  2. phoenix

    structure padding

    phoenix, Mar 11, 2005, in forum: C Programming
    Replies:
    1
    Views:
    425
    Peter Nilsson
    Mar 11, 2005
  3. Replies:
    6
    Views:
    481
    Flash Gordon
    May 18, 2005
  4. Stephen Mayes

    structure padding

    Stephen Mayes, May 20, 2005, in forum: C Programming
    Replies:
    5
    Views:
    459
    Dave Thompson
    May 31, 2005
  5. Kislay

    Size of a structure : Structure Padding

    Kislay, Oct 1, 2007, in forum: C Programming
    Replies:
    15
    Views:
    986
    clinuxpro
    Jul 13, 2011
Loading...

Share This Page