This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C++: Aligned byte fields not possible in classes?

Hi,
if I want to define a 4byte aligned char array in C, then I typically would declare:

__align(4) char acBuf[20];

In C++, inside a class, this unfortunately fails (Error #328: invalid storage class for a class member).

Is there any way to enforce alignment for C++ class members?

0