Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Data structure alignment
//Title of this code //Compiler Version 18.00.21005.1 for x86 #include <iostream> typedef struct { char a; long b; char c; } Struct1; typedef struct { char a; char c; long b; } Struct2; typedef struct { long b; char a; char c; } Struct3; int main() { std::cout << "sizeof(char)=" << sizeof(char) << std::endl; std::cout << "sizeof(long)=" << sizeof(long) << std::endl; std::cout << sizeof(Struct1) << std::endl; std::cout << sizeof(Struct2) << std::endl; std::cout << sizeof(Struct3) << std::endl; }
run
|
edit
|
history
|
help
0
list multiply
C++ string format
Multi Inheritance
Struct packing
Two-phase sample with Visual C++ 2015
fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
#26
MSVC C2888 bug
Affine Key Finder and Decrypter
hgh