Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #5917

Are struct members are also padded?

From Tech ID <tech@spamtrap.invalid>
Newsgroups comp.lang.c
Subject Are struct members are also padded?
Date 2011-06-12 21:09 +0000
Organization Aioe.org NNTP Server
Message-ID <it39te$if3$1@speranza.aioe.org> (permalink)

Show all headers | View raw


struct pad1 {
    char c1;

};

struct pad2 {
    char c1;
    int x;

};

struct pad3 {
    char c1;
    char c2;
    int x;

};

struct pad4 {
    char c1;
    char c2;
    int x;
    struct pad1 {
       char c1;
    };

};

What will be the sizeof for the structs above? (for 32-bit and 64-bit
machines). 

Back to comp.lang.c | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Are struct members are also padded? Tech ID <tech@spamtrap.invalid> - 2011-06-12 21:09 +0000
  Re: Are struct members are also padded? Ian Collins <ian-news@hotmail.com> - 2011-06-13 09:13 +1200
  Re: Are struct members are also padded? Shao Miller <sha0.miller@gmail.com> - 2011-06-12 16:13 -0500
  Re: Are struct members are also padded? Angel <angel+news@spamcop.net> - 2011-06-12 21:26 +0000
  Re: Are struct members are also padded? Stephen Sprunk <stephen@sprunk.org> - 2011-06-12 16:32 -0500
  Re: Are struct members are also padded? Keith Thompson <kst-u@mib.org> - 2011-06-12 14:39 -0700

csiph-web