The structure body contains bit segments, and its data memory distribution

Source: Internet
Author: User

struct _packer_data { unsigned char isdll:1; Whether it is a DLL unsigned char config:3; Set unsigned char oldoep:4; Program Entry point int nSize; Bit and non-segment data can coexist }; Structure Expansion: ?1<------1bit------>|<------3bit------->|<------4bit------>|<-------32bit--------> | isdll Config Oldoep nSize G_stcpackdata.isdll = 1; 1 g_stcpackdata.config = 5; 101 (if more than 3 bits, take only 3 bits lower) G_stcpackdata.oldoep = 9; 1001 g_stcpackdata.nsize = 0xFFFFFFFF g_stcpackdata structure variables in-memory data are arranged in: 9B the FF FF FF FF //According to VS default 8 byte aligned|---> 1001 1011 (Right-to-left arrangement of bit data) oldoep+config+isdll

The structure body contains bit segments, and its data memory distribution

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.