typedef _packed struct 含义
时间: 2023-11-03 09:20:08 浏览: 224
C_C++中typedef_struct和struct的用法
5星 · 资源好评率100%
"typedef _packed struct" 这个语句的含义是定义一个使用了对齐关键字"_packed"的结构体。对于ARM平台的编译器,由于没有提供类似于"#pragma pack"这样的丰富带参数对齐指令,所以使用关键字"_packed"可以实现结构体的字节对齐。这样定义的结构体在存储时会按照成员的顺序依次排列,并且没有任何填充字节,以最小的内存开销存储数据。在上述引用的例子中,"_packed_1_"是对"_packed"关键字的参数设置,用于指定结构体的对齐方式。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [typedef __packed struct](https://blog.csdn.net/weixin_36155610/article/details/117644488)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [acdat_readme.txt](https://download.csdn.net/download/tian_cang/3554305)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文