Data structure alignment
I was suffering with data structure alignment.
But,
I have found
"#pragma pack(1)".
argument: 1~16.
It can be packed a element of memory.
ex:
#ifndef __ETH_H__ #define __ETH_H__ #include <iostream> class foo{ public: #pragma pack(1) struct sc{ ushort a; short b; char c; }; #pragma pack() }; #endif
GOD