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.

TMDSCNCD280049C: 结构体字节对齐的问题

Part Number: TMDSCNCD280049C

请问大家关于字节对齐的问题

#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)没啥作用,达不到对齐的目的。