Struct alignment vs alignment of fields

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Aug 8 11:20:40 PDT 2014


yeah, chars (and bytes, and so on) are not aligned. i.e.

align(1) struct B {
   int qtim;
   int bid;
   int ofr;
   int bidsiz;
   int ofrsiz;
   short mode;
   char ex;
   byte mmid;
   char z;
}

has sizeof == 25. not sure if specs mentions this, but they 
should.


More information about the Digitalmars-d-learn mailing list