请问大家关于字节对齐的问题
#pragma pack(1);
typedef struct test
{
long e;
short a;
} test;
#pragma pack();
现在sizeof(test)=4。
请问CCS字节对齐的关键字是什么呢,我想让它1字节对齐,也就是sizeof(test)=3;CCS好像对#pragma pack(1)没啥作用,达不到对齐的目的。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
请问大家关于字节对齐的问题
#pragma pack(1);
typedef struct test
{
long e;
short a;
} test;
#pragma pack();
现在sizeof(test)=4。
请问CCS字节对齐的关键字是什么呢,我想让它1字节对齐,也就是sizeof(test)=3;CCS好像对#pragma pack(1)没啥作用,达不到对齐的目的。
比如3.15.2章节中有数据对齐,7.17中有域/结构体对齐