[英]How structs are saved in memory C
How structs in C are saved in the memory? C中的结构如何保存在内存中?
Why sometimes the struct length in the memory is bigger than expected? 为什么有时存储器中的结构长度大于预期的长度?
That's called data structure alignment . 这就是所谓的数据结构对齐 。
Although not a perfect duplicate, you can find a good explanation of this in C at Structure padding and packing 尽管不是完美的副本,但是您可以在C的“ 结构填充和打包”中找到对此的很好解释。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.