Description: The algorithm of structure alignment < Common algorithms and data structure >
Because of the need to do an automatic configuration of the platform, it involves the problem of structural parsing. Because the structure automatically aligns the boundaries at compile time, it is impossible to get the correct offset of each member variable without an accurate algorithm. In order to solve this problem I checked a circle of information on the Internet, see the related introduction on the MSDN, but always not found a direct algorithm, but under his hands, bit by bit grope for implementation of these rules. After a day of experimentation, we finally found the algorithm. To provide a reference for future friends who need to solve the same problem, this algorithm is provided to vckbase. I would also like to thank the vckbase for the friends who have provided me with help.
The source code consists of two parts, some of which are formal calling functions, and some are called demo programs, which are all included in the AlignOffSet. CPP file. This file has been compiled and run successfully on vc ++ 6.0.
To Search:
- [1111111111111111111111111] - And complete darkness to measure the mer
- [Test] - By cyclic list Joseph Central problem to
- [yy] - A hospital medicine, outpatient, hospita
File list (Check if you may need any files):