Category : alignment

The relevant paragraph is [basic.stc.dynamic.allocation]/3 (emphasis mine): (3) For an allocation function other than a reserved placement allocation function, the pointer returned on a successful call shall represent the address of storage that is aligned as follows: (3.1) — If the allocation function takes an argument of type std​::​align_­val_­t, the storage will have the alignment ..

Read more

Misaligned pointer is scaring me. When parsing string, a helpful technique I normally use is treating a group of chars as one unit. So if I am comparing a string to where <!– is 4 chars that mean begin comment, I would do… if( *(unsigned int*)string == tobe32(‘<!–‘) ) // This is beggining of a ..

Read more