zoukankan      html  css  js  c++  java
  • Byte Order, Size, and Alignment

    Byte Order, Size, and Alignment

      By default, C types are represented in the machine’s native format and byte order, and properly aligned by skipping pad bytes if necessary (according to the rules used by the C compiler).

      Alternatively, the first character of the format string can be used to indicate the byte order, size and alignment of the packed data, according to the following table:

      

      If the first character is not one of these, '@' is assumed.

      Native size and alignment are determined using the C compiler’s sizeof expression. This is always combined with native byte order.

      The form '!' is available for those poor souls who claim they can’t remember whether network byte order is big-endian or little-endian.

      

    Notes:

    1. Padding is only automatically added between successive structure members. No padding is added at the beginning or the end of the encoded struct. 
    2. No padding is added when using non-native size and alignment, e.g. with ‘<’, ‘>’, ‘=’, and ‘!’. 
  • 相关阅读:
    笔记-JavaWeb学习之旅13
    笔记-JavaWeb学习之旅12
    笔记-JavaWeb学习之旅11
    笔记-JavaWeb学习之旅10
    EF Core CodeFirst
    C#泛型
    软件工程笔记(二)
    第一章 软件工程概述
    软件工程笔记(一)
    MySql笔记(二)
  • 原文地址:https://www.cnblogs.com/tekka/p/4548602.html
Copyright © 2011-2022 走看看